Method and apparatus for encoding video in consideration of scanning order of coding units having hierarchical structure, and method and apparatus for decoding video in consideration of scanning order of coding units having hierarchical structure

ABSTRACT

A method and apparatus for decoding a video and a method and apparatus for encoding a video are provided. The method for decoding the video includes: receiving and parsing a bitstream of an encoded video; extracting, from the bitstream, encoded image data of a current picture of the encoded video assigned to a maximum coding unit, and information about a coded depth and an encoding mode according to the maximum coding unit; and decoding the encoded image data for the maximum coding unit based on the information about the coded depth and the encoding mode for the maximum coding unit, in consideration of a raster scanning order for the maximum coding unit and a zigzag scanning order for coding units of the maximum coding unit according to depths.

CROSS-REFERENCE TO RELATED PATENT APPLICATION

This application claims the benefit of Korean Patent Application No.10-2009-0075432, filed on Aug. 14, 2009, in the Korean IntellectualProperty Office, the disclosure of which is incorporated herein in itsentirety by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to encoding and decoding a video.

2. Description of the Related Art

As hardware for reproducing and storing high resolution or high qualityvideo content is being developed and supplied, a need for a video codecfor effectively encoding or decoding the high resolution or high qualityvideo content is increasing. In a related art video codec, a video isencoded according to a limited encoding method based on a macroblockhaving a predetermined size. In addition, in a related art video codec,video data is encoded and decoded by scanning macroblocks according to araster method.

SUMMARY

Apparatuses and methods consistent with exemplary embodiments provide adata scanning order associated with encoding and decoding of videos, anda neighboring relationship between data.

According to an aspect of an exemplary embodiment, there is provided amethod of decoding a video, the method including: receiving and parsinga bitstream of an encoded video; extracting, from the bitstream, encodedimage data of a current picture of the encoded video assigned to amaximum coding unit of the current picture, and information about acoded depth and an encoding mode according to the maximum coding unit,wherein the maximum coding unit is a coding unit of the current picturehaving a maximum size; and decoding the encoded image data for themaximum coding unit based on the information about the coded depth andthe encoding mode for the maximum coding unit, in consideration of araster scanning order for the maximum coding unit and a zigzag scanningorder for coding units of the maximum coding unit according to depths,wherein the maximum coding unit is spatially split into at least onecoding unit according to at least one depth, and as a depth deepens froman uppermost depth, the maximum coding unit is hierarchically split fromthe maximum coding unit corresponding to the uppermost depth to at leastone minimum coding unit corresponding to a lowermost depth of the atleast one depth, wherein the at least one coding unit is a deeper codingunit.

The decoding the encoded image data may include analyzing a hierarchicalstructure of at least one deeper coding unit for the maximum coding unitby using the information about the coded depth and the encoding mode forthe maximum coding unit.

The decoding the encoded image data may include searching for a locationof the maximum coding unit, based on an address of the maximum codingunit according to the raster scanning order.

The decoding the encoded image data may include searching for a locationof a minimum unit, based on an index of the minimum unit according to azigzag scanning order for the maximum coding unit.

The decoding the encoded image data may include searching for a locationof a minimum unit, based on an index of the minimum unit according to araster scanning order for the maximum coding unit.

The decoding the encoded image data may include mutually transforming anindex of a minimum unit according to a zigzag scanning order and anindex of the minimum unit according to a raster scanning order to eachother, for the maximum coding unit.

A location of the maximum coding unit may be expressed as a location ofa pixel located on a left upper end of the maximum coding unit that isrelative to a location of a sample located on a left upper end of thecurrent picture.

A location of a minimum unit may be expressed as a location of a pixellocated on a left upper end of the minimum unit that is relative to alocation of a sample located on a left upper end of the maximum codingunit.

In the decoding the encoded image data, neighborhood information may bereferred to by checking usability of the neighborhood information, inconsideration of a scanning order of the maximum coding unit, aprediction unit, a partition, and a minimum unit.

The decoding the encoded image data may include checking usability ofthe maximum coding unit.

In a case other than a case where the maximum coding unit is notincluded in the current picture, a case where the maximum coding unit isnot included in a current slice, and a case where an address of themaximum coding unit is later than an address of a current maximum codingunit in terms of a scanning order, data corresponding to the maximumcoding unit may be used.

The decoding the encoded image data may include checking usability of atleast one deeper coding unit included in the maximum coding unit.

In a case other than a case where the maximum coding unit is notincluded in the current picture, a case where the maximum coding unit isnot included in a current slice, a case where an address of the maximumcoding unit is later than an address of a current maximum coding unit interms of a scanning order, and a case where an index of a minimum uniton a left upper side of a deeper coding unit according to a zigzagscanning order is later in terms of a scanning order than an index ofthe minimum unit according to a zigzag scanning order, datacorresponding to the deeper coding unit may be used.

The decoding the encoded image data may include checking at least onemaximum coding unit adjacent to the maximum coding unit and usability ofthe at least one adjacent maximum coding unit.

The at least one maximum coding unit adjacent to the maximum coding unitmay include at least one of a maximum coding unit on a left side of themaximum coding unit, a maximum coding unit on an upper side of themaximum coding unit, a maximum coding unit on a right upper side of themaximum coding unit, and a maximum coding unit on a left upper side ofthe maximum coding unit.

The decoding the encoded image data may further include checking atleast one minimum unit adjacent to a current prediction unit included inthe maximum coding unit and usability of the at least one adjacentminimum unit.

The at least one minimum unit adjacent to the current prediction unitmay include at least one of a minimum unit on a left side of the currentprediction unit, a minimum unit on an upper side of the currentprediction unit, a minimum unit on a right upper side of the currentprediction unit, a minimum unit on a left upper side of the currentprediction unit, and a minimum unit on a left lower side of the currentprediction unit.

The decoding the encoded image data may further include checking alocation and usability of at least one boundary adjacent to the maximumcoding unit.

The at least one boundary adjacent to the maximum coding unit mayinclude at least one of a maximum coding unit on a left side of themaximum coding unit, a maximum coding unit on an upper side of themaximum coding unit, a maximum coding unit on a right upper side of themaximum coding unit, and a maximum coding unit on a left upper side ofthe maximum coding unit.

The minimum unit may be assigned with encoding information including atleast one of information about a corresponding deeper coding unit,information about splitting of the corresponding deeper coding unit intoa prediction unit or a partition, and information about a predictionmode of the prediction unit or the partition.

The decoding the encoded image data may further include checkingusability of a deeper coding unit or a prediction unit that includes theminimum unit, based on the encoding information assigned to the minimumunit.

The maximum coding unit may include a plurality of coding units, andwhen a first coding unit, of the plurality of coding units, which isadjacent to a second coding unit, of the plurality of coding units, isscanned later than the second coding unit according to a raster scanningorder and the first coding unit is scanned earlier than the secondcoding unit according to a zigzag scanning order, the first coding unitmay be referenced to decode the second coding unit.

When the first coding unit is on a left lower side of the second codingunit, the first coding unit may be referenced to decode the secondcoding unit.

When the first coding unit is on a left lower side of the second codingunit, a right boundary of the first coding unit may be referenced todecode the second coding unit.

According to an aspect of another exemplary embodiment, there isprovided a method of encoding a video, the method including: splitting acurrent picture of the video into a maximum coding unit; determining acoded depth to output a final encoding result according to at least onesplit region obtained by splitting a region of the maximum coding unitaccording to depths, by encoding the at least one split region, based onat least one depth that deepens in proportion to a number of times thatthe region of the maximum coding unit is split; and encoding andoutputting image data encoded at a coded depth determined for themaximum coding unit, and information about the coded depth and anencoding mode, wherein the encoding is performed in consideration of araster scanning order for the maximum coding unit and a zigzag scanningorder for at least one coding unit included in the maximum coding unit.

In the method, neighborhood information including a data unit located ona left lower side of a current data unit may be referenced to encodeimage data corresponding to the current data unit.

The neighborhood information may include a maximum coding unit on a leftside of the maximum coding unit, a maximum coding unit on an upper sideof the maximum coding unit, a maximum coding unit on a right upper sideof the maximum coding unit, and a maximum coding unit on a left upperside of the maximum coding unit.

The neighborhood information may include a minimum unit on a left sideof a current prediction unit, a minimum unit on an upper side of thecurrent prediction unit, a minimum unit on a right upper side of thecurrent prediction unit, a minimum unit on a left upper side of thecurrent prediction unit, and a minimum unit on a left lower side of thecurrent prediction unit.

The neighborhood information may include a right boundary of a codingunit located on the left lower side of the current prediction unit.

The maximum coding unit may include a plurality of coding units, andwhen a first coding unit, of the plurality of coding units, which isadjacent to a second coding unit, of the plurality of coding units, isscanned later than the second coding unit according to a raster scanningorder and the first coding unit is scanned earlier than the secondcoding unit according to a zigzag scanning order, the first coding unitmay be used as neighborhood information which is used to encode thesecond coding unit.

The first coding unit may be on a left lower side of the second codingunit.

According to an aspect of another exemplary embodiment, there isprovided an apparatus for decoding a video, the apparatus including: areceiver which receives and parses a bitstream of an encoded video; animage data and encoding information extractor which extracts, from thebitstream, encoded image data of a current picture of the encoded videoassigned to a maximum coding unit of the current picture, andinformation about a coded depth and an encoding mode according to themaximum coding unit, wherein the maximum coding unit is a coding unit ofthe current picture having a maximum size; and an image data decoderwhich decodes the encoded image data for the maximum coding unit basedon the information about the coded depth and the encoding mode for themaximum coding unit, in consideration of a raster scanning order for themaximum coding unit and a zigzag scanning order for coding unitsaccording to depths, wherein as a depth deepens from an uppermost depth,the maximum coding unit is hierarchically split from the maximum codingunit corresponding to the uppermost depth to minimum coding unitscorresponding to a lowermost depth.

According to an aspect of another exemplary embodiment, there isprovided an apparatus for encoding a video, the apparatus including: amaximum coding unit splitter which splits a current picture of the videointo a maximum coding unit; an coding unit determiner which determines acoded depth to output a final encoding result according to at least onesplit region obtained by splitting a region of the maximum coding unitaccording to depths, by encoding the at least one split region, based ona depth that deepens in proportion to a number of times that the regionof the maximum coding unit is split; and an output unit which encodesand outputs image data encoded at a coded depth determined for themaximum coding unit, and information about the coded depth and anencoding mode, wherein the encoding is performed in consideration of araster scanning order for the maximum coding unit and a zigzag scanningorder for at least one coding unit included in the maximum coding unit.

According to an aspect of another exemplary embodiment, there isprovided a computer readable recording medium having recorded thereon aprogram for executing the method of decoding a video.

According to an aspect of another exemplary embodiment, there isprovided a computer readable recording medium having recorded thereon aprogram for executing the method of encoding a video.

According to an aspect of another exemplary embodiment, there isprovided a method of decoding a video, the method including: extracting,from a bitstream, encoded image data of a current picture of the videoassigned to a maximum coding unit of the current picture, andinformation about a coded depth according to the maximum coding unit,wherein the maximum coding unit is a coding unit of the current picturehaving a maximum size; and decoding the encoded image data for themaximum coding unit based on the information about the coded depth, inconsideration of a raster scanning order for the maximum coding unit anda zigzag scanning order for coding units of the maximum coding unitaccording to depths, wherein the maximum coding unit is spatially splitinto at least one coding unit according to at least one depth, and as adepth deepens from an uppermost depth, the maximum coding unit ishierarchically split from the maximum coding unit corresponding to theuppermost depth to at least one minimum coding unit corresponding to alowermost depth of the at least one depth, wherein the at least onecoding unit is a deeper coding unit.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and/or other aspects will become more apparent by describingin detail exemplary embodiments thereof with reference to the attacheddrawings in which:

FIG. 1 is a block diagram of an apparatus for encoding a video,according to an exemplary embodiment;

FIG. 2 is a block diagram of an apparatus for decoding a video,according to an exemplary embodiment;

FIG. 3 is a diagram for describing a concept of coding units accordingto an exemplary embodiment;

FIG. 4 is a block diagram of an image encoder based on coding unitsaccording to an exemplary embodiment;

FIG. 5 is a block diagram of an image decoder based on coding unitsaccording to an exemplary embodiment;

FIG. 6 is a diagram illustrating deeper coding units according to depthsand prediction units according to an exemplary embodiment;

FIG. 7 is a diagram for describing a relationship between a coding unitand transformation units, according to an exemplary embodiment;

FIG. 8 is a diagram for describing encoding information of coding unitscorresponding to a coded depth, according to an exemplary embodiment;

FIG. 9 is a diagram of deeper coding units according to depths,according to an exemplary embodiment;

FIGS. 10 through 12 are diagrams for describing a relationship betweencoding units, prediction units, and transformation units, according toan exemplary embodiment;

FIG. 13 is a diagram for describing a relationship between a codingunit, a prediction unit, and a transformation unit, according toencoding mode information according to an exemplary embodiment;

FIG. 14 illustrates a raster scanning order of a maximum coding unit,according to an exemplary embodiment;

FIG. 15 illustrates a raster scanning order of minimum units, accordingto an exemplary embodiment;

FIG. 16 illustrates a zigzag scanning order of minimum units, accordingto an exemplary embodiment;

FIG. 17 illustrates a relationship between locations and scan indices ofa coding unit, a prediction unit, a partition, and a transformationunit, according to an exemplary embodiment;

FIG. 18 illustrates a scan index of a coding unit, according to anexemplary embodiment;

FIG. 19 illustrates a scanning order of coding units according to scanindices of the coding units, according to an exemplary embodiment;

FIG. 20 illustrates scan indices of partitions according to partitiontypes, according to an exemplary embodiment;

FIG. 21 illustrates data units that can be used as neighborhoodinformation of a current data unit, according to an exemplaryembodiment;

FIG. 22 illustrates maximum coding units adjacent to a current maximumcoding unit, according to an exemplary embodiment;

FIG. 23 illustrates macroblocks complying with a raster scanning method;

FIG. 24 illustrates a current prediction unit complying with a zigzagscanning order, according to an exemplary embodiment;

FIG. 25 illustrates minimum units adjacent to a current partition,according to an exemplary embodiment;

FIG. 26 is a diagram for explaining a motion vector predicting methodusing neighborhood information, according to an exemplary embodiment;

FIG. 27 illustrates an interpolating method using neighborhoodinformation, according to an exemplary embodiment of the presentinvention;

FIG. 28 is a flowchart illustrating a method of encoding a video byusing neighborhood information, according to an exemplary embodiment;and

FIG. 29 is a flowchart illustrating a method of decoding a video byusing neighborhood information, according to an exemplary embodiment.

DETAILED DESCRIPTION OF EXEMPLARY EMBODIMENTS

Hereinafter, exemplary embodiments will be described more fully withreference to the accompanying drawings, in which like reference numeralsrefer to like elements throughout. Expressions such as “at least oneof,” when preceding a list of elements, modify the entire list ofelements and do not modify the individual elements of the list.

Hereinafter, a coding unit is an encoding data unit in which the imagedata is encoded at an encoder side and an encoded data unit in which theencoded image data is decoded at a decoder side, according to exemplaryembodiments. Also, a coded depth indicates a depth where a coding unitis encoded.

Hereinafter, an ‘image’ may denote a still image for a video or a movingimage, that is, the video itself.

FIG. 1 is a block diagram of a video encoding apparatus 100, accordingto an exemplary embodiment. Referring to FIG. 1, the video encodingapparatus 100 includes a maximum coding unit splitter 110, a coding unitdeterminer 120, and an output unit 130.

The maximum coding unit splitter 110 may split a current picture basedon a maximum coding unit for the current picture of an image. If thecurrent picture is larger than the maximum coding unit, image data ofthe current picture may be split into the at least one maximum codingunit. The maximum coding unit according to an exemplary embodiment maybe a data unit having a size of 32×32, 64×64, 128×128, 256×256, etc.,wherein a shape of the data unit is a square having a width and heightin squares of 2. The image data may be output to the coding unitdeterminer 120 according to the at least one maximum coding unit.

A coding unit according to an exemplary embodiment may be characterizedby a maximum size and a depth. The depth denotes a number of times thecoding unit is spatially split from the maximum coding unit.Accordingly, as the depth deepens, deeper encoding units according todepths may be split from the maximum coding unit to a minimum codingunit. A depth of the maximum coding unit is an uppermost depth and adepth of the minimum coding unit is a lowermost depth. Since a size of acoding unit corresponding to each depth decreases as the depth of themaximum coding unit deepens, a coding unit corresponding to an upperdepth may include a plurality of coding units corresponding to lowerdepths.

As described above, the image data of the current picture is split intoone or more maximum coding units according to a maximum size of thecoding unit, and each of the maximum coding units may include deepercoding units that are split according to depths. Since the maximumcoding unit according to an exemplary embodiment is split according todepths, the image data of a spatial domain included in the maximumcoding unit may be hierarchically classified according to depths.

A maximum depth and a maximum size of a coding unit, which limit thetotal number of times a height and a width of the maximum coding unitare hierarchically split may be predetermined.

The coding unit determiner 120 encodes at least one split regionobtained by splitting a region of the maximum coding unit according todepths, and determines a depth to output a finally encoded image dataaccording to the at least one split region. For example, the coding unitdeterminer 120 determines a coded depth by encoding the image data inthe deeper coding units according to depths, according to the maximumcoding unit of the current picture, and selecting a depth having theleast encoding errors. Thus, the encoded image data of the coding unitcorresponding to the determined coded depth is output by the coding unitdeterminer 120. Also, the coding units corresponding to the coded depthmay be regarded as encoded coding units.

The determined coded depth and the encoded image data according to thedetermined coded depth are output to the output unit 130.

The image data in the maximum coding unit is encoded based on the deepercoding units corresponding to at least one depth equal to or below themaximum depth, and results of encoding the image data are compared basedon each of the deeper coding units. A depth having the least encodingerrors may be selected after comparing encoding errors of the deepercoding units. At least one coded depth may be selected for each maximumcoding unit.

The size of the maximum coding unit is split as a coding unit ishierarchically split according to depths, and as the number of codingunits increases. Also, even if coding units correspond to the same depthin one maximum coding unit, it is determined whether to split each ofthe coding units corresponding to the same depth to a lower depth bymeasuring an encoding error of the image data of each coding unit,separately. Accordingly, even when image data is included in one maximumcoding unit, the image data is split to regions according to the depthsand the encoding errors may differ according to regions in the onemaximum coding unit. Thus, the coded depths may differ according toregions in the image data. Therefore, one or more coded depths may bedetermined in one maximum coding unit, and the image data of the maximumcoding unit may be divided according to coding units of at least onecoded depth.

Accordingly, the coding unit determiner 120 may determine coding unitshaving a tree structure included in the maximum coding unit. The codingunits having a tree structure according to an exemplary embodimentinclude coding units corresponding to a depth determined to be the codeddepth, from among all deeper coding units included in the maximum codingunit. A coding unit of a coded depth may be hierarchically determinedaccording to depths in the same region of the maximum coding unit, andmay be independently determined in different regions. Similarly, a codeddepth in a current region may be independently determined from a codeddepth in another region.

A maximum depth according to an exemplary embodiment is an index relatedto a number of splitting times from a maximum coding unit to a minimumcoding unit. A first maximum depth according to an exemplary embodimentmay denote a total number of splitting times from the maximum codingunit to the minimum coding unit. A second maximum depth according to anexemplary embodiment may denote a total number of depth levels from themaximum coding unit to the minimum coding unit. For example, when adepth of the maximum coding unit is 0, a depth of a coding unit, inwhich the maximum coding unit is split once, may be set to 1, and adepth of a coding unit, in which the maximum coding unit is split twice,may be set to 2. Here, if the minimum coding unit is a coding unit inwhich the maximum coding unit is split four times, 5 depth levels ofdepths 0, 1, 2, 3 and 4 exist. In this case, the first maximum depth maybe set to 4, and the second maximum depth may be set to 5.

Prediction encoding and transformation may be performed according to themaximum coding unit. The prediction encoding and the transformation mayalso be performed based on the deeper coding units according to a depthequal to, or depths less than, the maximum depth, according to themaximum coding unit. Transformation may be performed according to amethod of orthogonal transformation or integer transformation.

Since the number of deeper coding units increases whenever the maximumcoding unit is split according to depths, encoding including theprediction encoding and the transformation may be performed on all ofthe deeper coding units generated as the depth deepens. For convenienceof description, the prediction encoding and the transformation will nowbe described based on a coding unit of a current depth, in a maximumcoding unit.

The video encoding apparatus 100 may variously select a size or shape ofa data unit for encoding the image data. In order to encode the imagedata, operations, such as prediction encoding, transformation, andentropy encoding, are performed, and at this time, the same data unitmay be used for all operations or different data units may be used foreach operation.

For example, the video encoding apparatus 100 may select not only acoding unit for encoding the image data, but also a data unit differentfrom the coding unit so as to perform the prediction encoding on theimage data in the coding unit.

In order to perform the prediction encoding in the maximum coding unit,the prediction encoding may be performed based on a coding unitcorresponding to a coded depth, i.e., based on a coding unit that is nolonger split to coding units corresponding to a lower depth.Hereinafter, the coding unit that is no longer split and becomes a basisunit for the prediction encoding will now be referred to as a predictionunit. A partition obtained by splitting the prediction unit may includea prediction unit or a data unit obtained by splitting at least one of aheight and a width of the prediction unit.

For example, when a coding unit of a size of 2N×2N (where N is apositive integer) is no longer split and becomes a prediction unit of2N×2N, a size of a partition may be 2N×2N, 2N×N, N×2N, or N×N. Examplesof a partition type include symmetrical partitions that are obtained bysymmetrically splitting a height or a width of the prediction unit,partitions obtained by asymmetrically splitting the height or the widthof the prediction unit (such as 1:n or n:1), partitions that areobtained by geometrically splitting the prediction unit, and partitionshaving arbitrary shapes.

A prediction mode of the prediction unit may be at least one of an intramode, a inter mode, and a skip mode. For example, the intra mode or theinter mode may be performed on the partition of 2N×2N, 2N×N, N×2N, orN×N. Also, the skip mode may be performed only on the partition of2N×2N. The encoding is independently performed on prediction units in acoding unit, thereby selecting a prediction mode having a least encodingerror.

The video encoding apparatus 100 may also perform the transformation onthe image data in a coding unit based not only on the coding unit forencoding the image data, but also based on a data unit that is differentfrom the coding unit.

In order to perform the transformation in the coding unit, thetransformation may be performed based on a data unit having a sizesmaller than or equal to the coding unit. For example, the data unit forthe transformation may include a data unit for an intra mode and a dataunit for an inter mode.

A data unit used as a base of the transformation will hereinafter bereferred to as a transformation unit. A transformation depth indicatinga number of splitting times to reach the transformation unit bysplitting a height and a width of the coding unit may also be set forthe transformation unit. For example, in a current coding unit of 2N×2N,a transformation depth may be 0 when a size of a transformation unit isalso 2N×2N, may be 1 when each of the height and the width of thecurrent coding unit is split into two equal parts, totally split into4^1 transformation units, and the size of the transformation unit isthus N×N, and may be 2 when each of the height and the width of thecurrent coding unit is split into four equal parts, totally split into4^2 transformation units, and the size of the transformation unit isthus N/2×N/2. For example, the transformation unit may be set accordingto a hierarchical tree structure, in which a transformation unit of anupper transformation depth is split into four transformation units of alower transformation depth according to hierarchical characteristics ofa transformation depth.

Similar to the coding unit, the transformation unit in the coding unitmay be recursively split into smaller sized regions, so that thetransformation unit may be determined independently in units of regions.Thus, residual data in the coding unit may be divided according to thetransformation having the tree structure according to transformationdepths.

Encoding information according to coding units corresponding to a codeddepth uses not only information about the coded depth, but alsoinformation about information related to prediction encoding andtransformation. Accordingly, the coding unit determiner 120 not onlydetermines a coded depth having a minimum encoding error, but alsodetermines a partition type in a prediction unit, a prediction modeaccording to prediction units, and a size of a transformation unit fortransformation.

Coding units according to a tree structure in a maximum coding unit anda method of determining a partition, according to one or more exemplaryembodiments, will be described in detail later with reference to FIGS. 3through 12.

The coding unit determiner 120 may measure an encoding error of deepercoding units according to depths by using Rate-Distortion Optimizationbased on Lagrangian multipliers.

The output unit 130 outputs the image data of the maximum coding unit,which is encoded based on the at least one coded depth determined by thecoding unit determiner 120, and information about the encoding modeaccording to the coded depth, in bitstreams. The encoded image data maybe obtained by encoding residual data of an image. The information aboutthe encoding mode according to coded depth may include at least one ofinformation about the coded depth, information about the partition typein the prediction unit, the prediction mode, and the size of thetransformation unit.

The information about the coded depth may be defined by using splitinformation according to depths, which indicates whether encoding isperformed on coding units of a lower depth instead of a current depth.If the current depth of the current coding unit is the coded depth,image data in the current coding unit is encoded and output, and thusthe split information may be defined not to split the current codingunit to a lower depth. Alternatively, if the current depth of thecurrent coding unit is not the coded depth, the encoding is performed onthe coding unit of the lower depth. Thus, the split information may bedefined to split the current coding unit to obtain the coding units ofthe lower depth.

If the current depth is not the coded depth, encoding is performed onthe coding unit that is split into the coding unit of the lower depth.Since at least one coding unit of the lower depth exists in one codingunit of the current depth, the encoding is repeatedly performed on eachcoding unit of the lower depth. Thus, the encoding may be recursivelyperformed for the coding units having the same depth.

Since the coding units having a tree structure are determined for onemaximum coding unit, and information about at least one encoding mode isdetermined for a coding unit of a coded depth, information about atleast one encoding mode may be determined for one maximum coding unit.Also, a coded depth of the image data of the maximum coding unit may bedifferent according to locations since the image data is hierarchicallysplit according to depths. Thus, information about the coded depth andthe encoding mode may be set for the image data.

Accordingly, the output unit 130 may assign encoding information about acorresponding coded depth and an encoding mode to at least one of thecoding unit, the prediction unit, and a minimum unit included in themaximum coding unit.

The minimum unit according to an exemplary embodiment may be arectangular data unit obtained by splitting the minimum coding unithaving the lowermost depth by 4. Alternatively, the minimum unit may bea maximum-size rectangular data unit that may be included in all of thecoding units, prediction units, partition units, and transformationunits included in the maximum coding unit.

For example, the encoding information output through the output unit 130may be classified into encoding information according to coding units,and encoding information according to prediction units. The encodinginformation according to the coding units may include at least one ofinformation about the prediction mode and information about a size ofthe partitions. The encoding information according to the predictionunits may include at least one of information about an estimateddirection of an inter mode, information about a reference image index ofthe inter mode, information about a motion vector, information about achroma component of an intra mode, and information about aninterpolation method of the intra mode. Also, information about amaximum size of the coding unit defined according to pictures, slices,or groups of pictures (GOPs), and information about a maximum depth maybe inserted into a Sequence Parameter Set (SPS) or a header of abitstream.

In the video encoding apparatus 100, the deeper coding unit may be acoding unit obtained by dividing at least one of a height and a width ofa coding unit of an upper depth, which is one layer above, by two. Inother words, when the size of the coding unit of the current depth is2N×2N, the size of the coding unit of the lower depth may be N×N. Also,the coding unit of the current depth having the size of 2N×2N mayinclude 4 of the coding units of the lower depth.

Accordingly, the video encoding apparatus 100 may form the coding unitshaving the tree structure by determining coding units having an optimumshape and an optimum size for each maximum coding unit, based on thesize of the maximum coding unit and the maximum depth both determinedconsidering characteristics of the current picture. Also, since encodingmay be performed on each maximum coding unit by using any of variousprediction modes and transformations, an optimum encoding mode may bedetermined considering characteristics of the coding unit of variousimage sizes.

Thus, if an image having a high resolution or a large amount of data isencoded in units of related art macroblocks, a number of macroblocks perpicture excessively increases. Accordingly, a number of pieces ofcompressed information generated for each macroblock increases, and thusit is difficult to transmit the compressed information and datacompression efficiency decreases. However, by using the video encodingapparatus 100 according to an exemplary embodiment, image compressionefficiency may be increased since a coding unit is adjusted whileconsidering characteristics of an image while increasing a maximum sizeof a coding unit while considering a size of the image.

FIG. 2 is a block diagram of a video decoding apparatus 200, accordingto an exemplary embodiment of the present invention. Referring to FIG.2, the video decoding apparatus 200 includes a receiver 210, an imagedata and encoding information extractor 220, and an image data decoder230. Definitions of various terms, such as a coding unit, a depth, aprediction unit, a transformation unit, and information about variousencoding modes, for various operations of the video decoding apparatus200 are the same or similar to those described above with reference toFIG. 1 and the video encoding apparatus 100.

The receiver 210 receives and parses a bitstream of an encoded video.The image data and encoding information extractor 220 extracts encodedimage data for each coding unit from the parsed bitstream, wherein thecoding units have a tree structure according to each maximum codingunit, and outputs the extracted image data to the image data decoder230. The image data and encoding information extractor 220 may extractinformation about a maximum size of a coding unit of a current picturefrom a header corresponding to the current picture or an SPS.

Also, the image data and encoding information extractor 220 extractsinformation about a coded depth and an encoding mode for the codingunits having a tree structure according to each maximum coding unit,from the parsed bitstream. The extracted information about the codeddepth and the encoding mode is output to the image data decoder 230.Thus, the image data in a bit stream is split into the maximum codingunit so that the image data decoder 230 decodes the image data for eachmaximum coding unit.

The information about the coded depth and the encoding mode according tothe maximum coding unit may be set for information about at least onecoding unit corresponding to the coded depth. Furthermore, theinformation about the encoding mode may include at least one ofinformation about a partition type of a corresponding coding unitcorresponding to the coded depth, information about a prediction mode,and a size of a transformation unit. Also, splitting informationaccording to depths may be extracted as the information about the codeddepth.

The information about the coded depth and the encoding mode according toeach maximum coding unit extracted by the image data and encodinginformation extractor 220 is information about a coded depth and anencoding mode determined to generate a minimum encoding error when anencoder, such as the video encoding apparatus 100, repeatedly performsencoding for each deeper coding unit according to depths according toeach maximum coding unit. Accordingly, the video decoding apparatus 200may restore an image by decoding the image data according to a codeddepth and an encoding mode that generates the minimum encoding error.

Since encoding information about the coded depth and the encoding modemay be assigned to a predetermined data unit from among a correspondingcoding unit, a prediction unit, and a minimum unit, the image data andencoding information extractor 220 may extract the information about thecoded depth and the encoding mode according to the predetermined dataunits. The predetermined data units to which the same information aboutthe coded depth and the encoding mode is assigned may be inferred to bethe data units included in the same maximum coding unit.

The image data decoder 230 restores the current picture by decoding theimage data in each maximum coding unit based on the information aboutthe coded depth and the encoding mode according to the maximum codingunits. In other words, the image data decoder 230 may decode the encodedimage data based on the extracted information about the partition type,the prediction mode, and the transformation unit for each coding unitfrom among the coding units having the tree structure included in eachmaximum coding unit. A decoding process may include at least one of aprediction including intra prediction and motion compensation, and aninverse transformation. Inverse transformation may be performedaccording to method of inverse orthogonal transformation or inverseinteger transformation.

The image data decoder 230 may perform intra prediction or motioncompensation according to a partition and a prediction mode of eachcoding unit, based on the information about the partition type and theprediction mode of the prediction unit of the coding unit according tocoded depths.

Also, the image data decoder 230 may perform inverse transformationaccording to each transformation unit in the coding unit, based on theinformation about the size of the transformation unit of the coding unitaccording to coded depths, so as to perform the inverse transformationaccording to maximum coding units.

The image data decoder 230 may determine at least one coded depth of acurrent maximum coding unit by using split information according todepths. If the split information indicates that image data is no longersplit in the current depth, the current depth is a coded depth.Accordingly, the image data decoder 230 may decode encoded data of atleast one coding unit corresponding to each coded depth in the currentmaximum coding unit by using the information about the partition type ofthe prediction unit, the prediction mode, and the size of thetransformation unit for each coding unit corresponding to the codeddepth, and output the image data of the current maximum coding unit.

In other words, data units including the encoding information includingthe same split information may be gathered by observing the encodinginformation set assigned for the predetermined data unit from among thecoding unit, the prediction unit, and the minimum unit. Moreover, thegathered data units may be considered to be one data unit to be decodedby the image data decoder 230 in the same encoding mode.

The video decoding apparatus 200 may obtain information about at leastone coding unit that generates the minimum encoding error when encodingis recursively performed for each maximum coding unit, and may use theinformation to decode the current picture. In other words, the codingunits having the tree structure determined to be the optimum codingunits in each maximum coding unit may be decoded. Also, a maximum sizeof the coding unit may be determined considering resolution and anamount of image data.

Accordingly, even if image data has a high resolution and a large amountof data, the image data may be efficiently decoded and restored by usinga size of a coding unit and an encoding mode, which are adaptivelydetermined according to characteristics of the image data, by usinginformation about an optimum encoding mode received from an encoder.

A method of determining coding units having a tree structure, aprediction unit, and a transformation unit, according to one or moreexemplary embodiments will now be described with reference to FIGS. 3through 13.

FIG. 3 is a diagram for describing a concept of coding units accordingto an exemplary embodiment. A size of a coding unit may be expressed inwidth×height, and may be 64×64, 32×32, 16×16, and 8×8, though it isunderstood that another exemplary embodiment is not limited thereto. Acoding unit of 64×64 may be split into partitions of 64×64, 64×32,32×64, or 32×32, a coding unit of 32×32 may be split into partitions of32×32, 32×16, 16×32, or 16×16, a coding unit of 16×16 may be split intopartitions of 16×16, 16×8, 8×16, or 8×8, and a coding unit of 8×8 may besplit into partitions of 8×8, 8×4, 4×8, or 4×4.

Referring to FIG. 3, first video data 310 has a resolution of 1920×1080,a maximum size of a coding unit of 64, and a maximum depth of 2. Secondvideo data 320 has a resolution of 1920×1080, a maximum size of a codingunit of 64, and a maximum depth of 3. Third video data 330 has aresolution of 352×288, a maximum size of a coding unit of 16, and amaximum depth of 1. The maximum depth shown in FIG. 3 denotes a totalnumber of splits from a maximum coding unit to a minimum decoding unit.

If a resolution is high or a data amount is large, a maximum size of acoding unit may be large so as to not only increase encoding efficiencybut also to accurately reflect characteristics of an image. Accordingly,the maximum size of the coding units of the first and second video data310 and 320 having a higher resolution than the third video data 330 maybe 64.

Since the maximum depth of the first video data 310 is 2, coding units315 of the first video data 310 may include a maximum coding unit havinga long axis size of 64, and coding units having long axis sizes of 32and 16 since depths are deepened to two layers by splitting the maximumcoding unit twice. Meanwhile, since the maximum depth of the third videodata 330 is 1, coding units 335 of the third video data 330 may includea maximum coding unit having a long axis size of 16, and coding unitshaving a long axis size of 8 since depths are deepened to one layer bysplitting the maximum coding unit once.

Since the maximum depth of the second video data 320 is 3, coding units325 of the second video data 320 may include a maximum coding unithaving a long axis size of 64, and coding units having long axis sizesof 32, 16, and 8 since the depths are deepened to 3 layers by splittingthe maximum coding unit three times. As a depth deepens (i.e.,increases), detailed information may be precisely expressed.

FIG. 4 is a block diagram of an image encoder 400 based on coding units,according to an embodiment of the present invention. Referring to FIG.4, the image encoder 400 performs operations of the coding unitdeterminer 120 of the video encoding apparatus 100 to encode image data.For example, an intra predictor 410 performs intra prediction on codingunits in an intra mode, from among a current frame 405, and a motionestimator 420 and a motion compensator 425 perform inter estimation andmotion compensation, respectively, on coding units in an inter mode fromamong the current frame 405 by using the current frame 405, and areference frame 495.

Data output from the intra predictor 410, the motion estimator 420, andthe motion compensator 425 is output as a quantized transformationcoefficient through a transformer 430 and a quantizer 440. The quantizedtransformation coefficient is restored as data in a spatial domainthrough an inverse quantizer 460 and an inverse transformer 470. Therestored data in the spatial domain is output as the reference frame 495after being post-processed through a deblocking unit 480 and a loopfiltering unit 490. The quantized transformation coefficient may beoutput as a bitstream 455 through an entropy encoder 450.

In order for the image encoder 400 to be applied in the video encodingapparatus 100, elements of the image encoder 400, i.e., the intrapredictor 410, the motion estimator 420, the motion compensator 425, thetransformer 430, the quantizer 440, the entropy encoder 450, the inversequantizer 460, the inverse transformer 470, the deblocking unit 480, andthe loop filtering unit 490, perform operations based on each codingunit from among coding units having a tree structure while consideringthe maximum depth of each maximum coding unit.

Specifically, the intra predictor 410, the motion estimator 420, and themotion compensator 425 determine partitions and a prediction mode ofeach coding unit from among the coding units having a tree structurewhile considering a maximum size and a maximum depth of a currentmaximum coding unit, and the transformer 430 determines a size of thetransformation unit in each coding unit from among the coding unitshaving a tree structure.

FIG. 5 is a block diagram of an image decoder 500 based on coding units,according to an exemplary embodiment. Referring to FIG. 5, a parser 510parses encoded image data to be decoded and information about encodingused for decoding from a bitstream 505. The encoded image data is outputas inverse quantized data through an entropy decoder 520 and an inversequantizer 530, and the inverse quantized data is restored to image datain a spatial domain through an inverse transformer 540.

An intra predictor 550 performs intra prediction on coding units in anintra mode with respect to the image data in the spatial domain, and amotion compensator 560 performs motion compensation on coding units inan inter mode by using a reference frame 585.

The image data in the spatial domain, which passed through the intrapredictor 550 and the motion compensator 560, may be output as arestored frame 595 after being post-processed through a deblocking unit570 and a loop filtering unit 580. Also, the image data that ispost-processed through the deblocking unit 570 and the loop filteringunit 580 may be output as the reference frame 585.

In order to decode the image data in the image data decoder 230 of thevideo decoding apparatus 200, the image decoder 500 may performoperations that are performed after the parser 510.

In order for the image decoder 500 to be applied in the video decodingapparatus 200, elements of the image decoder 500, i.e., the parser 510,the entropy decoder 520, the inverse quantizer 530, the inversetransformer 540, the intra predictor 550, the motion compensator 560,the deblocking unit 570, and the loop filtering unit 580, performoperations based on coding units having a tree structure for eachmaximum coding unit.

Specifically, the intra prediction 550 and the motion compensator 560perform operations based on partitions and a prediction mode for each ofthe coding units having a tree structure, and the inverse transformer540 performs operations based on a size of a transformation unit foreach coding unit.

FIG. 6 is a diagram illustrating deeper coding units according todepths, and partitions, according to an exemplary embodiment. A videoencoding apparatus 100 according to an exemplary embodiment and a videodecoding apparatus 200 according to an exemplary embodiment usehierarchical coding units so as to consider characteristics of an image.A maximum height, a maximum width, and a maximum depth of coding unitsmay be adaptively determined according to the characteristics of theimage, or may be differently set by a user. Sizes of deeper coding unitsaccording to depths may be determined according to a predeterminedmaximum size of the coding unit.

Referring to FIG. 6, in a hierarchical structure 600 of coding units,according to an exemplary embodiment, the maximum height and the maximumwidth of the coding units are each 64, and the maximum depth is 4. Sincea depth deepens (i.e., increases) along a vertical axis of thehierarchical structure 600, a height and a width of the deeper codingunits are each split. Also, a prediction unit and partitions, which arebases for prediction encoding of each deeper coding unit, are shownalong a horizontal axis of the hierarchical structure 600.

For example, a first coding unit 610 is a maximum coding unit in thehierarchical structure 600, wherein a depth thereof is 0 and a size,i.e., a height by width, thereof is 64×64. The depth deepens along thevertical axis such that the hierarchical structure 600 includes a secondcoding unit 620 having a size of 32×32 and a depth of 1, a third codingunit 630 having a size of 16×16 and a depth of 2, a fourth coding unit640 having a size of 8×8 and a depth of 3, and a fifth coding unit 650having a size of 4×4 and a depth of 4. The fifth coding unit 650 havingthe size of 4×4 and the depth of 4 is a minimum coding unit.

The prediction unit and the partitions of the coding units 610, 620,630, 640, and 650 are arranged along the horizontal axis according toeach depth. In other words, if the first coding unit 610 having the sizeof 64×64 and the depth of 0 is a prediction unit, the prediction unitmay be split into partitions included in the first coding unit 610, i.e.a partition 610 having a size of 64×64, partitions 612 having a size of64×32, partitions 614 having the size of 32×64, or partitions 616 havinga size of 32×32.

Similarly, a prediction unit of the second coding unit 620 having thesize of 32×32 and the depth of 1 may be split into partitions includedin the second coding unit 620, i.e. a partition 620 having a size of32×32, partitions 622 having a size of 32×16, partitions 624 having asize of 16×32, and partitions 626 having a size of 16×16.

Similarly, a prediction unit of the third coding unit 630 having thesize of 16×16 and the depth of 2 may be split into partitions includedin the third coding unit 630, i.e. a partition having a size of 16×16included in the third coding unit 630, partitions 632 having a size of16×8, partitions 634 having a size of 8×16, and partitions 636 having asize of 8×8.

Similarly, a prediction unit of the fourth coding unit 640 having thesize of 8×8 and the depth of 3 may be split into partitions included inthe fourth coding unit 640, i.e. a partition having a size of 8×8included in the fourth coding unit 640, partitions 642 having a size of8×4, partitions 644 having a size of 4×8, and partitions 646 having asize of 4×4.

The fifth coding unit 650 having the size of 4×4 and the depth of 4 isthe minimum coding unit and a coding unit of the lowermost depth. Aprediction unit of the fifth coding unit 650 is assigned to a partitionhaving a size of 4×4.

In order to determine the at least one coded depth of the coding unitsof the maximum coding unit 610, the coding unit determiner 120 of thevideo encoding apparatus 100 performs encoding for coding unitscorresponding to each depth included in the maximum coding unit 610.

A number of deeper coding units according to depths including data inthe same range and the same size increases as the depth deepens. Forexample, four coding units corresponding to a depth of 2 are required tocover data that is included in one coding unit corresponding to a depthof 1. Accordingly, in order to compare encoding results of the same dataaccording to depths, the coding unit corresponding to the depth of 1 andfour coding units corresponding to the depth of 2 are each encoded.

In order to perform encoding for a current depth from among the depths,a minimum encoding error may be selected for the current depth byperforming encoding for each prediction unit in the coding unitscorresponding to the current depth, along the horizontal axis of thehierarchical structure 600. Alternatively, the minimum encoding errormay be searched for by comparing the minimum encoding errors accordingto depths, by performing encoding for each depth as the depth deepensalong the vertical axis of the hierarchical structure 600. A depth and apartition having the minimum encoding error in the first coding unit 610may be selected as the coded depth and a partition type of the firstcoding unit 610.

FIG. 7 is a diagram for describing a relationship between a coding unit710 and transformation units 720, according to an exemplary embodiment.The video encoding apparatus 100 according to an exemplary embodimentand a video decoding apparatus 200 according to an exemplary embodimentencodes and decodes, respectively, an image according to coding unitshaving sizes smaller than or equal to a maximum coding unit for eachmaximum coding unit. Sizes of transformation units for transformationduring encoding may be selected based on data units that are not largerthan a corresponding coding unit.

Referring to FIG. 7, for example, in the video encoding apparatus 100,if a size of the coding unit 710 is 64×64, transformation may beperformed by using the transformation units 720 having a size of 32×32.

Also, data of the coding unit 710 having the size of 64×64 may beencoded by performing the transformation on each of the transformationunits having the size of 32×32, 16×16, 8×8, and 4×4, which are smallerthan 64×64, and then a transformation unit having the least codingerrors may be selected.

FIG. 8 is a diagram for describing encoding information of coding unitscorresponding to a coded depth, according to an exemplary embodiment.Referring to FIG. 8, the output unit 130 of a video encoding apparatus100 according to an exemplary embodiment may encode and transmit firstinformation 800 about a partition type, second information 810 about aprediction mode, and third information 820 about a size of atransformation unit for each coding unit corresponding to a coded depth,as information about an encoding mode.

The first information 800 indicates information about a shape of apartition obtained by splitting a prediction unit of a current codingunit, wherein the partition is a data unit for prediction encoding thecurrent coding unit. For example, a current coding unit CU_(—)0 having asize of 2N×2N may be split into any one of a partition 802 having a sizeof 2N×2N, a partition 804 having a size of 2N×N, a partition 806 havinga size of N×2N, and a partition 808 having a size of N×N. Here, thefirst information 800 about a partition type is set to indicate one ofthe partition 804 having a size of 2N×N, the partition 806 having a sizeof N×2N, and the partition 808 having a size of N×N

The second information 810 indicates a prediction mode of eachpartition. For example, the second information 810 may indicate a modeof prediction encoding performed on a partition indicated by the firstinformation 800, i.e., an intra mode 812, an inter mode 814, or a skipmode 816.

The third information 820 indicates a transformation unit to be based onwhen transformation is performed on a current coding unit. For example,the transformation unit may be a first intra transformation unit 822, asecond intra transformation unit 824, a first inter transformation unit826, or a second intra transformation unit 828.

An image data and encoding information extractor 220 of a video decodingapparatus 200 according to an exemplary embodiment may extract and usethe information 800, 810, and 820 for decoding, according to each deepercoding unit

FIG. 9 is a diagram of deeper coding units according to depths,according to an exemplary embodiment. Split information may be used toindicate a change of a depth. The spilt information indicates whether acoding unit of a current depth is split into coding units of a lowerdepth.

Referring to FIG. 9, a prediction unit 910 for prediction encoding acoding unit 900 having a depth of 0 and a size of 2N_(—)0×2N_(—)0 mayinclude partitions of a partition type 912 having a size of2N_(—)0×2N_(—)0, a partition type 914 having a size of 2N_(—)0×N_(—)0, apartition type 916 having a size of N_(—)0×2N_(—)0, and a partition type918 having a size of N_(—)0×N_(—)0. FIG. 9 only illustrates thepartition types 912 through 918 which are obtained by symmetricallysplitting the prediction unit 910, but it is understood that a partitiontype is not limited thereto in another exemplary embodiment. Forexample, according to another exemplary embodiment, the partitions ofthe prediction unit 910 may include asymmetrical partitions, partitionshaving a predetermined shape, and partitions having a geometrical shape.

Prediction encoding is repeatedly performed on one partition having asize of 2N_(—)0×2N_(—)0, two partitions having a size of 2N_(—)0×N_(—)0,two partitions having a size of N_(—)0×2N_(—)0, and four partitionshaving a size of N_(—)0×N_(—)0, according to each partition type. Theprediction encoding in an intra mode and an inter mode may be performedon the partitions having the sizes of 2N_(—)0×2N_(—)0, N_(—)0×2N_(—)0,2N_(—)0×N_(—)0, and N_(—)0×N_(—)0. The prediction encoding in a skipmode is performed only on the partition having the size of2N_(—)0×2N_(—)0.

Errors of encoding including the prediction encoding in the partitiontypes 912 through 918 are compared, and the minimum encoding error isdetermined among the partition types. If an encoding error is smallestin one of the partition types 912 through 916, the prediction unit 910may not be split into a lower depth.

If the encoding error is the smallest in the partition type 918, a depthis changed from 0 to 1 to split the partition type 918 in operation 920,and encoding is repeatedly performed on coding units 930 having a depthof 2 and a size of N_(—)0×N_(—)0 to search for a minimum encoding error.

A prediction unit 940 for prediction encoding the coding unit 930 havinga depth of 1 and a size of 2N_(—)1×2N_(—)1 (=N_(—)0×N_(—)0) may includepartitions of a partition type 942 having a size of 2N_(—)1×2N_(—)1, apartition type 944 having a size of 2N_(—)1×N_(—)1, a partition type 946having a size of N_(—)1×2N_(—)1, and a partition type 948 having a sizeof N_(—)1×N_(—)1.

If an encoding error is the smallest in the partition type 948, a depthis changed from 1 to 2 to split the partition type 948 in operation 950,and encoding is repeatedly performed on coding units 960, which have adepth of 2 and a size of N_(—)2×N_(—)2 to search for a minimum encodingerror.

When a maximum depth is d, split operations according to each depth maybe performed up to when a depth becomes d−1, and split information maybe encoded up to when a depth is one of 0 to d−2. For example, whenencoding is performed up to when the depth is d−1 after a coding unitcorresponding to a depth of d−2 is split in operation 970, a predictionunit 990 for prediction encoding a coding unit 980 having a depth of d−1and a size of 2N_(d−1)×2N_(d−1) may include partitions of a partitiontype 992 having a size of 2N_(d−1)×2N_(d−1), a partition type 994 havinga size of 2N_(d−1)×N_(d−1), a partition type 996 having a size ofN_(d−1)×2N_(d−1), and a partition type 998 having a size ofN_(d−1)×N_(d−1).

Prediction encoding may be repeatedly performed on one partition havinga size of 2N_(d−1)×2N_(d−1), two partitions having a size of2N_(d−1)×N_(d−1), two partitions having a size of N_(d−1)×2N_(d−1), fourpartitions having a size of N_(d−1)×N_(d−1) from among the partitiontypes 992 through 998 to search for a partition type having a minimumencoding error.

Even when the partition type 998 has the minimum encoding error, since amaximum depth is d, a coding unit CU_(d−1) having a depth of d−1 is nolonger split to a lower depth, and a coded depth for the coding units ofa current maximum coding unit 900 is determined to be d−1 and apartition type of the current maximum coding unit 900 may be determinedto be N_(d−1)×N_(d−1). Also, since the maximum depth is d and a minimumcoding unit 980 having a lowermost depth of d−1 is no longer split to alower depth, split information for the minimum coding unit 980 is notset.

A data unit 999 may be considered a minimum unit for the current maximumcoding unit. A minimum unit according to an exemplary embodiment may bea rectangular data unit obtained by splitting a minimum coding unit 980by 4. By performing the encoding repeatedly, a video encoding apparatus100 according to an exemplary embodiment may select a depth having theminimum encoding error by comparing encoding errors according to depthsof the coding unit 900 to determine a coded depth, and set acorresponding partition type and a prediction mode as an encoding modeof the coded depth.

As such, the minimum encoding errors according to depths are compared inall of the depths of 1 through d, and a depth having the least encodingerrors may be determined as a coded depth. At least one of the codeddepth, the partition type of the prediction unit, and the predictionmode may be encoded and transmitted as information about an encodingmode. Also, since a coding unit is split from a depth of 0 to a codeddepth, only split information of the coded depth is set to 0, and splitinformation of depths excluding the coded depth are set to 1.

An image data and encoding information extractor 220 of a video decodingapparatus 200 according to an exemplary embodiment may extract and usethe information about the coded depth and the prediction unit of thecoding unit 900 to decode the partition 912. The video decodingapparatus 200 may determine a depth, in which split information is 0, asa coded depth by using split information according to depths, and useinformation about an encoding mode of the corresponding depth fordecoding.

FIGS. 10 through 12 are diagrams for describing a relationship betweencoding units 1010, prediction units 1060, and transformation units 1070,according to an exemplary embodiment.

Referring to FIGS. 10 through 12, the coding units 1010 are coding unitshaving a tree structure, corresponding to coded depths determined by avideo encoding apparatus 100 according to an exemplary embodiment, in amaximum coding unit. The prediction units 1060 are partitions ofprediction units of each of the coding units 1010, and thetransformation units 1070 are transformation units of each of the codingunits 1010.

When a depth of a maximum coding unit is 0 in the coding units 1010,depths of coding units 1012 and 1054 are 1, depths of coding units 1014,1016, 1018, 1028, 1050, and 1052 are 2, depths of coding units 1020,1022, 1024, 1026, 1030, 1032, and 1048 are 3, and depths of coding units1040, 1042, 1044, and 1046 are 4.

In the prediction units 1060, some encoding units 1014, 1016, 1022,1032, 1048, 1050, 1052, and 1054 are obtained by splitting the codingunits of the coding units 1010. For example, partition types in thecoding units 1014, 1022, 1050, and 1054 have a size of 2N×N, partitiontypes in the coding units 1016, 1048, and 1052 have a size of N×2N, anda partition type of the coding unit 1032 has a size of N×N. Predictionunits and partitions of the coding units 1010 are smaller than or equalto each coding unit.

Transformation or inverse transformation is performed on image data ofthe coding unit 1052 in the transformation units 1070 in a data unitthat is smaller than the coding unit 1052. Also, the coding units 1014,1016, 1022, 1032, 1048, 1050, and 1052 in the transformation units 1070are different from those in the prediction units 1060 in terms of sizesand shapes. For example, video encoding and decoding apparatuses 100 and200 according to exemplary embodiments may perform intra prediction,motion estimation, motion compensation, transformation, and inversetransformation individually on a data unit in the same coding unit.

Accordingly, encoding is recursively performed on each of coding unitshaving a hierarchical structure in each region of a maximum coding unitto determine an optimum coding unit, and thus coding units having arecursive tree structure may be obtained. Encoding information mayinclude at least one of split information about a coding unit,information about a partition type, information about a prediction mode,and information about a size of a transformation unit. Table 1 showsexemplary encoding information that may be set by the video encoding anddecoding apparatuses 100 and 200.

TABLE 1 Split Information 0 (Encoding on Coding Unit having Size of 2N ×2N and Current Depth of d) Size of Transformation Unit Partition TypeSplit Split Symmetrical Asymmetrical Information 0 of Information 1 ofPrediction Partition Partition Transformation Transformation Split ModeType Type Unit Unit Information 1 Intra 2N × 2N 2N × nU 2N × 2N N × NRepeatedly Inter 2N × N 2N × nD (Symmetrical Encode Skip N × 2N nL × 2NType) Coding Units (Only N × N nR × 2N N/2 × N/2 having 2N × 2N)(Asymmetrical Lower Depth Type) of d + 1

An output unit 130 of the video encoding apparatus 100 may output theencoding information about the coding units having a tree structure, andan image data and encoding information extractor 220 of the videodecoding apparatus 200 may extract the encoding information about thecoding units having a tree structure from a received bitstream.

Split information indicates whether a current coding unit is split intocoding units of a lower depth. If split information of a current depth dis 0, a depth in which a current coding unit is no longer split into alower depth is a coded depth, and thus information about a partitiontype, prediction mode, and a size of a transformation unit may bedefined for the coded depth. If the current coding unit is further splitaccording to the split information, encoding is independently performedon four split coding units of a lower depth.

A prediction mode may be one of an intra mode, an inter mode, and a skipmode. The intra mode and the inter mode may be defined in all partitiontypes, and the skip mode may be defined only in a partition type havinga size of 2N×2N.

The information about the partition type may indicate symmetricalpartition types having sizes of 2N×2N, 2N×N, N×2N, and N×N, which areobtained by symmetrically splitting at least one of a height and a widthof a prediction unit, and asymmetrical partition types having sizes of2N×nU, 2N×nD, nL×2N, and nR×2N, which are obtained by asymmetricallysplitting at least one of the height and the width of the predictionunit. The asymmetrical partition types having the sizes of 2N×nU and2N×nD may be respectively obtained by splitting the height of theprediction unit in 1:3 and 3:1, and the asymmetrical partition typeshaving the sizes of nL×2N and nR×2N may be respectively obtained bysplitting the width of the prediction unit in 1:3 and 3:1

The size of the transformation unit may be set to be two types in theintra mode and two types in the inter mode. For example, if splitinformation of the transformation unit is 0, the size of thetransformation unit may be 2N×2N, which is the size of the currentcoding unit. If split information of the transformation unit is 1, thetransformation units may be obtained by splitting the current codingunit. Also, if a partition type of the current coding unit having thesize of 2N×2N is a symmetrical partition type, a size of atransformation unit may be N×N, and if the partition type of the currentcoding unit is an asymmetrical partition type, the size of thetransformation unit may be N/2×N/2.

The encoding information about coding units having a tree structure mayinclude at least one of a coding unit corresponding to a coded depth, aprediction unit, and a minimum unit. The coding unit corresponding tothe coded depth may include at least one of a prediction unit and aminimum unit including the same encoding information.

Accordingly, it is determined whether adjacent data units are includedin the same coding unit corresponding to the coded depth by comparingencoding information of the adjacent data units. Also, a correspondingcoding unit corresponding to a coded depth is determined by usingencoding information of a data unit, and thus a distribution of codeddepths in a maximum coding unit may be determined.

Therefore, if a current coding unit is predicted based on encodinginformation of adjacent data units, encoding information of data unitsin deeper coding units adjacent to the current coding unit may bedirectly referred to and used.

Alternatively, if a current coding unit is predicted based on encodinginformation of adjacent data units, data units adjacent to the currentcoding unit are searched using encoded information of the data units,and the searched adjacent coding units may be referred to for predictingthe current coding unit.

FIG. 13 is a diagram for describing a relationship between a codingunit, a prediction unit or a partition, and a transformation unit,according to encoding mode information of Table 1 according to anexemplary embodiment. Referring to FIG. 13, a maximum coding unit 1300includes coding units 1302, 1304, 1306, 1312, 1314, 1316, and 1318 ofcoded depths. Here, since the coding unit 1318 is a coding unit of acoded depth, split information may be set to 0. Information about apartition type of the coding unit 1318 having a size of 2N×2N may be setto be a partition type 1322 having a size of 2N×2N, a partition type1324 having a size of 2N×N, a partition type 1326 having a size of N×2N,a partition type 1328 having a size of N×N, a partition type 1332 havinga size of 2N×nU, a partition type 1334 having a size of 2N×nD, apartition type 1336 having a size of nL×2N, or a partition type 1338having a size of nR×2N.

When the partition type is set to be symmetrical, i.e., the partitiontype 1322, 1324, 1326, or 1328, a transformation unit 1342 having a sizeof 2N×2N is set if split information (TU size flag) of a transformationunit is 0, and a transformation unit 1344 having a size of N×N is set ifa TU size flag is 1.

When the partition type is set to be asymmetrical, i.e., the partitiontype 1332, 1334, 1336, or 1338, a transformation unit 1352 having a sizeof 2N×2N is set if a TU size flag is 0, and a transformation unit 1354having a size of N/2×N/2 is set if a TU size flag is 1.

Referring to FIG. 13, the TU size flag is a flag having a value or 0 or1, though it is understood that another exemplary embodiment is notlimited to a 1-bit flag, and a transformation unit may be hierarchicallysplit having a tree structure while the TU size flag increases from 0 inanother exemplary embodiment.

In this case, the size of a transformation unit that has been actuallyused may be expressed by using a TU size flag of a transformation unit,according to an exemplary embodiment, together with a maximum size andminimum size of the transformation unit. According to an exemplaryembodiment, a video encoding apparatus 100 is capable of encodingmaximum transformation unit size information, minimum transformationunit size information, and a maximum TU size flag. The result ofencoding the maximum transformation unit size information, the minimumtransformation unit size information, and the maximum TU size flag maybe inserted into an SPS. According to an exemplary embodiment, a videodecoding apparatus 200 may decode video by using the maximumtransformation unit size information, the minimum transformation unitsize information, and the maximum TU size flag.

For example, if the size of a current coding unit is 64×64 and a maximumtransformation unit size is 32×32, the size of a transformation unit maybe 32×32 when a TU size flag is 0, may be 16×16 when the TU size flag is1, and may be 8×8 when the TU size flag is 2.

As another example, if the size of the current coding unit is 32×32 anda minimum transformation unit size is 32×32, the size of thetransformation unit may be 32×32 when the TU size flag is 0. Here, theTU size flag cannot be set to a value other than 0, since the size ofthe transformation unit cannot be less than 32×32.

As another example, if the size of the current coding unit is 64×64 anda maximum TU size flag is 1, the TU size flag may be 0 or 1. Here, theTU size flag cannot be set to a value other than 0 or 1.

Thus, if it is defined that the maximum TU size flag isMaxTransformSizeIndex, a minimum transformation unit size isMinTransformSize, and a transformation unit size is RootTuSize when theTU size flag is 0, then a current minimum transformation unit sizeCurrMinTuSize that can be determined in a current coding unit, may bedefined by Equation (1):CurrMinTuSize=max(MinTransformSize,RootTuSize/(2^MaxTransformSizeIndex))  (1).

Compared to the current minimum transformation unit size CurrMinTuSizethat can be determined in the current coding unit, a transformation unitsize ‘RootTuSize’ when the TU size flag is 0 may denote a maximumtransformation unit size that can be selected in the system. In Equation(1), RootTuSize/(2^MaxTransformSizeIndex) denotes a transformation unitsize when the transformation unit size RootTuSize, when the TU size flagis 0, is split a number of times corresponding to the maximum TU sizeflag, and MinTransformSize denotes a minimum transformation size. Thus,a smaller value from among RootTuSize/(2^MaxTransformSizeIndex) andMinTransformSize may be the current minimum transformation unit sizeCurrMinTuSize that can be determined in the current coding unit.

According to an exemplary embodiment, the maximum transformation unitsize RootTuSize may vary according to the type of a prediction mode. Forexample, if a current prediction mode is an inter mode, then RootTuSizemay be determined by using Equation (2) below. In Equation (2),MaxTransformSize denotes a maximum transformation unit size, and PUSizedenotes a current prediction unit size:RootTuSize=min(MaxTransformSize,PUSize)  (2).

That is, if the current prediction mode is the inter mode, thetransformation unit size RootTuSize when the TU size flag is 0 may be asmaller value from among the maximum transformation unit size and thecurrent prediction unit size.

If a prediction mode of a current partition unit is an intra mode,RootTuSize may be determined by using Equation (3) below. In Equation(3), PartitionSize denotes the size of the current partition unit:RootTuSize=min(MaxTransformSize,PartitionSize)  (3).

That is, if the current prediction mode is the intra mode, thetransformation unit size RootTuSize when the TU size flag is 0 may be asmaller value from among the maximum transformation unit size and thesize of the current partition unit.

However, the current maximum transformation unit size RootTuSize thatvaries according to the type of a prediction mode in a partition unit isjust an example and it is understood that another exemplary embodimentis not limited thereto.

An index and a scanning order of a data unit based on coding unitshaving a tree structure, a prediction unit, and a transformation unit,according to one or more exemplary embodiments will now be described indetail with reference to FIGS. 14 through 27.

A video encoding apparatus 100 according to an exemplary embodiment usesa raster scanning order as an order in which encoding is performed inunits of maximum coding units included in a slice. Hierarchical codingunits according to depths included in a maximum coding unit may bescanned in a zigzag manner among coding units corresponding to the samedepth. Encoding of minimum units of each maximum coding unit may beperformed in a raster scanning order.

The video encoding apparatus 100 may refer to information about aneighborhood of a current data unit (hereinafter, referred to asneighborhood information of a current data unit) in order to encodeimage data corresponding to the current data unit. For example, when acurrent maximum coding unit, a current coding unit corresponding to acoded depth, or a current prediction unit are prediction-encoded,information about a maximum coding unit or current coding unitsaccording to depths adjacent to the current maximum coding unit, thecurrent coding unit corresponding to coded depth or the currentprediction unit, and the like may be referred to.

In detail, the neighborhood information may include information about atleast one of a maximum coding unit on a left side of the current maximumcoding unit, a maximum coding unit on an upper side thereof, a maximumcoding unit on a right upper side thereof, a maximum coding unit on aleft upper side thereof, etc. The neighborhood information may includeinformation about coding units located on at least one of the left side,the upper side, the right upper side, and the left upper side of thecurrent maximum coding unit. The neighborhood information may alsoinclude information about prediction units located on the left side, theupper side, the right upper side, the left upper side of the currentmaximum coding unit, etc. The neighborhood information may also includeinformation about partitions located on at least one of the left side,the upper side, the right upper side, the left upper side of the currentmaximum coding unit, etc.

The neighborhood information may also include information about minimumunits located on at least one of the left side, the upper side, theright upper side, the left upper side of the current prediction unit,etc.

Furthermore part of a data unit, as opposed to an entirety of data unitmay be referred to, as the neighborhood information. For example, theneighborhood information may include a right boundary of a maximumcoding unit located on a left lower side of the current prediction unit.

Since a data unit located on the left lower side of a current data unitis scanned later than the current data unit according to a rasterscanning order of an exemplary embodiment, the data unit located on theleft lower side of the current data unit may not be referred to whenencoding a current macroblock, in a macroblock encoding method complyingwith a raster scanning order. However, in the present exemplaryembodiment, even when maximum coding units only comply with a rasterscanning order, since minimum units and data units in the maximum codingunits can be scanned in a zigzag manner, the minimum units and the dataunits may serve as the neighborhood information.

A coding unit determiner 120 of the video encoding apparatus 100 maycheck a location and usability of a predetermined coding unit. Thechecked coding unit may a coding unit having a tree structure, that is,a coding unit corresponding to a coded depth. The coding unit determiner120 may check the location and usability of a data unit adjacent to acurrent data unit. The data unit adjacent to the current data unit mayinclude at least one of data units located on the left side, the upperside, the right upper side, and the left upper side of the current dataunit. The adjacent data unit to be checked may include at least one of amaximum coding unit, a coding unit, a prediction unit, a partition, atransformation unit, and a minimum unit.

An image data decoder 230 of a video decoding apparatus 200 according toan exemplary embodiment considers a raster scanning order for maximumcoding units and a zigzag scanning order for coding units according todepths, in order to decode image data corresponding to each maximumcoding unit encoded based on information about an coded depth and anencoding mode for each maximum coding unit to restore a current picture.Hereinafter, a coding unit that is scanned in consideration of a rasterscanning order for maximum coding units and a zigzag scanning order forcoding units according to depths is a coding unit corresponding to acoded depth from among coding units having a tree structure.

Neighborhood information may be referred to in order to decode a currentdata unit. For example, inter prediction on a current partition may beperformed by referring to a motion vector of a partition adjacent to thecurrent partition. Moreover, inter prediction on a current partition maybe performed by referring to a pixel value of a data unit adjacent to apixel value of the current partition.

The image data decoder 230 may check the location, usability, and thelike of the adjacent data unit which can be referred to in order todecode the current data unit. Accordingly, the image data decoder 230may refer to neighborhood information by checking the usability of theneighborhood information, in consideration of a raster scanning orderfor maximum coding units and partitions and a zigzag scanning order or araster scanning order for minimum units.

The image data decoder 230 may check the locations of data units basedon a scanning order. For example, the location of each maximum codingunit may be searched for, based on addresses of maximum coding unitsaccording to a raster scanning order.

Based on indices of minimum units according to a zigzag scanning order,the locations of the minimum units in a maximum coding unit may besearched for. Alternatively, based on the indices of minimum unitsaccording to a raster scanning order, the locations of the minimum unitsin a maximum coding unit may be searched for. The indices of the minimumunits according to a zigzag scanning order and the indices of theminimum units according to a raster scanning order may be mutuallytransformed to each other. For convenience of explanation, an indexbased on a scanning order is hereinafter referred to as a scan index.

Respective scan indices of a coding unit, a prediction unit, and atransformation unit may be expressed based on a scan index of a minimumunit in a corresponding maximum coding unit. A scan index of a partitionof the prediction unit may also be expressed based on the scan index ofthe minimum unit in the corresponding maximum coding unit.

Locations or coordinates of samples of the coding unit and theprediction unit may be expressed as coordinates in the correspondingmaximum coding unit. Locations or coordinates of samples of thepartition of the prediction unit and the transformation unit may also beexpressed as coordinates in the corresponding prediction unit.

A location of a current maximum coding unit may be expressed as alocation of a pixel located on the left upper side of the currentmaximum coding unit, which is relative to a location of a sample locatedon the left upper side of a current slice. A location of a currentminimum unit may be expressed as a location of a pixel located on theleft upper side of the current minimum unit, which is relative to alocation of a sample located on the left upper side of a correspondingmaximum coding unit.

The image data decoder 230 may check a location and usability of apredetermined coding unit. The coding unit to be checked may a codingunit having a tree structure, that is, a coding unit corresponding to acoded depth. The image data decoder 230 may check the location andusability of a maximum coding unit adjacent to a current maximum codingunit. The maximum coding unit adjacent to the current maximum codingunit may include at least one of maximum coding units located on theleft side, the upper side, the right upper side, and the left upper sideof the current maximum coding unit.

The image data decoder 230 may check a location, an index, and usabilityof a coding unit adjacent to a current coding unit. The coding unitadjacent to the current coding unit may include at least one of codingunits located on the left side and the upper side of the current codingunit. The checked coding unit may be one of the coding units having atree structure, that is, a coding unit corresponding to a coded depth.

The image data decoder 230 may check a location, an index, and usabilityof a prediction unit adjacent to a current prediction unit. Theprediction unit adjacent to the current prediction unit may include atleast one of prediction units located on the left side, the upper side,the right upper side, and the left upper side of the current predictionunit.

The image data decoder 230 may check a location, an index, and usabilityof a partition adjacent to a current prediction unit. The partitionadjacent to the current prediction unit may include at least one ofpartitions located on the left side, the upper side, the right upperside, and the left upper side of the current prediction unit.

The image data decoder 230 may check a location, an index, and usabilityof a minimum unit adjacent to a current prediction unit included in acurrent maximum coding unit. The minimum unit adjacent to the currentprediction unit may include at least one of minimum units located on theleft side, the upper side, the right upper side, and the left upper sideof the current prediction unit.

The image data decoder 230 may check a location and usability of aboundary adjacent to a current prediction unit. The boundary adjacent tothe current prediction unit may include a boundary of at least one ofdata units located on the left side, the upper side, the right upperside, the left upper side, and the left lower side of the currentprediction unit. Locations of pixels on the boundary may be expressed asa coordinate relative to a location of a pixel on the left upper side ofa current coding unit or may be expressed as a coordinate relative to alocation of a sample on the left upper side of a current maximum codingunit. If a pixel adjacent to the current coding unit deviates from thecurrent maximum coding unit, the pixel may be determined to be notuseable.

The image data decoder 230 may check usability of coding units accordingto depths or a prediction unit that include a minimum unit, based onencoding information of the minimum unit. Accordingly, the image datadecoder 230 may check locations or usabilities of a prediction unit,coding units according to depths, a maximum coding unit, and the likeadjacent to a current data unit, by using encoding information of aminimum unit adjacent to the current data unit.

According to a raster scanning order, at a point in time when a currentmaximum coding unit is scanned, a maximum coding unit located on theleft side or the upper side of the current maximum coding unit hasalready been decoded, but a maximum coding unit located on the rightside or the lower side of the current maximum coding unit has not yetbeen decoded.

A case where a maximum coding unit includes at least one macroblock isassumed to compare existing macroblocks with hierarchical data unitsaccording to an exemplary embodiment. A case where a first macroblockand a second macroblock are included in the same maximum coding unit andthe first macroblock is on the left lower side of the second macroblockwill now be illustrated.

According to a raster scanning order, the first macroblock is scannedlater than the second macroblock. According to a zigzag scanning order,the first macroblock is scanned earlier than the second macroblock. Inan encoding method, since the first macroblock is scanned later than thesecond macroblock according to a raster scanning order is encoded anddecoded later than the second macroblock, the second macroblock may notrefer to information about the first macroblock. However, the videoencoding apparatus 100 according to an embodiment of the presentinvention may refer to the first macroblock as neighborhood informationof the second macroblock when encoding the second macroblock.

Since the video encoding apparatus 100 and the video decoding apparatus200 according to exemplary embodiments use not only a raster scanningmethod, but also a zigzag scanning method for each of hierarchicalcoding units having a tree structure, the apparatuses 100 and 200 mayuse a wide range of neighborhood information compared with the relatedart.

FIG. 14 illustrates a raster scanning order of a maximum coding unit1610, according to an exemplary embodiment. Referring to FIG. 14, themaximum coding unit 1610 is scanned from a left end of a picture 1600 toa right end of the picture 1600, and from an upper end of the picture1600 to a lower end of the picture, according to the raster scanningorder. Accordingly, according to the raster scanning order, at a pointin time when a current maximum coding unit is scanned, a maximum codingunit located on the left side or upper side of the current maximumcoding unit has already been scanned, but a maximum coding unit locatedon the right side or lower side of the current maximum coding unit hasnot yet been scanned.

A video decoding apparatus 200 according to an exemplary embodiment maybe aware of the location of a current maximum coding unit complying witha raster scanning order, by ascertaining an address of the currentmaximum coding unit, a size of a maximum coding unit, and a size of apicture. Here, a location of the current maximum coding unit correspondsto a distance from a left upper end of the picture to a left upper endof the current maximum coding unit, and may be expressed as a locationof a pixel on the left upper side of the current maximum coding unit,which is relative to a location of a sample on the left upper side ofthe picture.

A scanning order of partitions of coding units according to depths willnow be described with reference to FIG. 9. According to the depths 0through d−1, the partitions of coding units according to depths complywith a raster scanning order. For example, if the depth is 0, apartition type 914 having a size of 2N_(—)0×N_(—)0 and a partition type916 having a size of N_(—)0×2N_(—)0 are each scanned in such as way thatpartitions having indices of 0 and 1 are scanned in an index order. Apartition type 918 having a size of N_(—)0×N_(—)0 is scanned in such asway that partitions having indices of 0, 1, 2, and 3 are scanned in anindex order.

An image data decoder 230 of the video decoding apparatus 200 may searchfor a location of a partition in each of coding units according todepths. In a current coding unit, when the index of a current partition,the size of each partition, and the size of the current coding unit areknown, the location of the current partition complying with a rasterscanning order may be ascertained.

Here, the location of the current partition corresponds to a distancefrom a left upper end of a current data unit to a left upper end of thecurrent partition, and may be expressed as a location of a pixel on theleft upper end of the current partition, which is relative to a locationof a sample on the left upper end of the current data unit.

According to one or more exemplary embodiments, minimum units in amaximum coding unit may be scanned in a zigzag scanning order or araster scanning order. Accordingly, an index based on a zigzag scanningorder and an index based on a raster scanning order may be defined foreach minimum unit. FIG. 15 illustrates minimum units 1710 complying witha raster scanning order according to an exemplary embodiment, and FIG.16 illustrates minimum units 1810 complying with a zigzag scanning orderaccording to an exemplary embodiment.

Referring to FIG. 15, the minimum units 1710 are scanned in a rasterscanning order, namely, from a left end of a maximum coding unit 1700 toa right end thereof and from an upper end thereof to a lower endthereof. Thus, scanning is performed starting from the minimum unit 1710on the upper end and in an order of minimum units having indices of 0,1, 2, 3, 4, 5, 6, and 7 from the left end to the right end. Then, thescanning moves down and is performed in an order of minimum units havingindices of 8, 9, 10, 11, 12, 13, 14, and 15. The scanning moves downagain and is performed in an order of minimum units having indices of16, 17, 18, and 19.

An image data decoder 230 of a video decoding apparatus 200 according toan exemplary embodiment may search for locations of the minimum units ineach maximum coding unit. When the index of a current minimum unit, thesize of each minimum unit, and the size of the current maximum codingunit complying with a raster scanning order are known, the location ofthe current minimum unit complying with a raster scanning order may beascertained.

Here, the location of the current minimum unit corresponds to a distancefrom a left upper end of a current maximum coding unit to a left upperend of the current minimum unit, and may be expressed as a location of apixel on the left upper end of the current minimum unit, which isrelative to a location of a sample on the left upper end of the currentmaximum coding unit.

Referring to FIG. 16, scanning in a zigzag scanning order is performedamong coding units corresponding to the same depth. For example, amaximum coding unit 1800 has a depth of 0, and the minimum units 1810have a depth of 3. Four minimum units are grouped, and zigzag scanningmay be performed in units of the group. In other words, minimum units1810 having indices of 0, 1, 2, and 3 are scanned in a zigzag scanningorder, and minimum units 1810 having indices of 4, 5, 6, and 7 arescanned in a zigzag scanning order.

A group of the minimum units 1810 having indices of 0, 1, 2, and 3 is acoding unit having a depth of 2. Accordingly, a first group includingthe minimum units 1810 having indices of 0, 1, 2, and 3, a second groupincluding the minimum units 1810 having indices of 4, 5, 6, and 7, athird group including the minimum units 1810 having indices of 8, 9, 10,and 11, and a fourth group including the minimum units 1810 havingindices of 12, 13, 14, and 15 are respectively coding units havingdepths of 2, and may be each scanned in a zigzag scanning order.

Similarly, scanning may be performed in a zigzag scanning order among 4coding units corresponding to the depth of 1, wherein each of the codingunits corresponding to the depth of 1 includes four coding unitscorresponding to the depth of 2.

An image data decoder 230 of a video decoding apparatus 200 according toan exemplary embodiment may search for locations of the minimum units ina maximum coding unit. When the index of a current minimum unit, thesize of each minimum unit, and the size of the current maximum codingunit complying with a zigzag scanning order are known, the location ofthe current minimum unit complying with a zigzag scanning order may beascertained.

Here, the location of the current minimum unit corresponds to a distancefrom a left upper end of a current maximum coding unit to a left upperend of the current minimum unit, and may be expressed as a location of apixel on the left upper end of the current minimum unit, which isrelative to a location of a sample on the left upper end of the currentmaximum coding unit.

The image data decoder 230 of the video decoding apparatus 200 maymutually transform indices of minimum units according to a zigzagscanning order and indices of minimum units according to a rasterscanning order to each other, within a maximum coding unit. The mutualtransformation may be performed in consideration of a size of a maximumcoding unit, a current depth, and a maximum depth.

FIG. 17 illustrates a relationship between locations and scan indices ofa coding unit, a prediction unit, a partition, and a transformationunit, according to an embodiment of the present invention. Referring toFIG. 17, a picture is split into slices, and a slice 1750 includes aplurality of maximum coding units LCUs. A location lcuAddr of a maximumcoding unit 1760 from among the maximum coding units LCUs included inthe slice 1750 may be expressed as a relative location of a sample onthe left upper end of the maximum coding unit 1760 compared to a sampleon the left upper end of the slice 1750.

A location of a coding unit 1770 from among coding units having a treestructure in the maximum coding unit 1760 may be expressed as a scanindex cuIdx of the coding unit 1770 compared to the sample on the leftupper end of the maximum coding unit 1760. If the coding unit 1770 is acoding unit corresponding to a coded depth, that is, a coding unit thatis no longer split to a lower depth, the coding unit 1770 becomes aprediction unit 1770, and the location of the prediction unit 1770 maybe expressed as a scan index puIdx of the prediction unit 1770 comparedto the sample on the left upper end of the maximum coding unit 1760.

The prediction unit 1770 may be split into at least one PU partition. APU partition 1790 from among the PU partitions of the prediction unit1770 may be expressed as a scan index puPartIdx of the PU partition 1790compared to the sample on the left upper end of the prediction unit1770. The prediction unit 1770 may include at least transformation unitsTUs. A transformation unit 1780 from among the transformation units ofthe prediction unit 1770 may be expressed as a scan index tuIdx of thetransformation unit 1780 compared to the sample on the left upper end ofthe prediction unit 1770.

A video encoding apparatus 100 according to an exemplary embodiment mayuse the locations and scan indices of a coding unit, a prediction unit,a partition, and a transformation unit described above with reference toFIG. 17, in order to perform video encoding. A video decoding apparatus200 according to an exemplary embodiment may decode encoded data of animage based on coding units having a tree structure, by using thelocations and scan indices of a coding unit, a prediction unit, apartition, and a transformation unit.

FIG. 18 illustrates a scan index of a coding unit 1850, according to anexemplary embodiment. Referring to FIG. 18, the coding unit 1850 has aheight of CUSize and a width of CUSize, and as the depth of the codingunit 1850 increases one level, the coding unit 1850 may be split intofour coding units CU₀, CU₁, CU₂, and CU₃ corresponding to a lower depth.The coding units CU₀, CU₁, CU₂, CU₃ each have a height of CUSize/2 and awidth of CUSize/2.

The scan index of the coding unit 1850 and the scan indices of thecoding units CU₀, CU₁, CU₂, and CU₃ are expressed as scan indices ofminimum units located on left upper ends of the coding unit 1850 and thecoding units CU₀, CU₁, CU₂, and CU₃, and a scan index of a minimum unitrepresents an order that the minimum unit is scanned in a maximum codingunit. For example, the index cuIdx of the coding unit 1850 represents anindex of a minimum unit on the left upper end of the coding unit 1850.

The size of a data unit such as a maximum coding unit, a coding unit, aprediction unit, a partition, or a transformation unit may be expressedas a number of minimum units thereof. For example, the number of minimumunits arranged on a height (width) of a data unit may indicate theheight (width) of the data unit.

Accordingly, since the scan indices of the coding units CU₀, CU₁, CU₂,and CU₃ correspond to locations apart from the left upper end of thecoding unit 1850 by the coding units CU₀, CU₁, CU₂, and CU₃, the scanindices of the coding units CU₀, CU₁, CU₂, and CU₃ may be expressedusing the sizes of the coding units CU₀, CU₁, CU₂, and CU₃ that increasefrom the scan index cuIdx of the coding unit 1850 in terms of the numberof minimum units. In detail, the scan indices of the coding units CU₀,CU₁, CU₂, and CU₃ may be defined as follows:

(1) the scan index of the coding unit CU₀ is cuIdx. Thus, the scan indexof the coding unit CU₀ is the same as that of the coding unit 1850,which is higher than the coding unit CU₀ in terms of depths.

(2) the scan index of the coding unit CU₁ increases from the scan indexof the upper coding unit 1850 by the number of minimum units,CuSizeInSu/2, arranged on a width of the coding unit CU₀. Thus, the scanindex of the coding unit CU₁ is cuIdx+CuSizeInSu/2.

(3) the scan index of the coding unit CU₂ increases from the scan indexof the upper coding unit 1850 by a product of the number of minimumunits, CuSizeInSu/2, arranged on a height of the coding unit CU₀ and thenumber of minimum units, LcuSizeInSu, arranged on a width of a maximumcoding unit. Thus, the scan index of the coding unit CU₂ iscuIdx+CuSizeInSu/2*LcuSizeInSu.

(4) the scan index of the coding unit CU₃ increases from the scan indexof the coding unit CU₂ by a horizontal size CuSizeInSu/2 of the codingunit CU₂. Thus, the scan index of the coding unit CU₃ iscuIdx+CuSizeInSu/2+CuSizeInSu/2*LcuSizeInSu.

FIG. 19 illustrates a scanning order of coding units according to scanindices of coding units, according to an exemplary embodiment. Referringto FIG. 19, coding units having a tree structure within a maximum codingunit 1900 may each have the same size as that of a minimum unit or maybe repeatedly split until, for example, further splitting is not allowedor possible. The coding units having a tree structure within the maximumcoding unit 1900 may include a coding unit 1970 having a depth of 1,coding units 1910, 1912, 1914, and 1916 having a depth of 2, codingunits 1960, 1962, 1964, and 1966 having a depth of 2, and coding units1920, 1922, 1924, 1926, 1930, 1932, 1934, 1936, 1940, 1942, 1944, 1946,1950, 1953, 1954, and 1956 having a depth of 3.

According to the present exemplary embodiment, zigzag scanning isperformed among all of the coding units having a tree structure, and isalso performed among coding units having the same depth.

Accordingly, a scanning order and scan indices of the coding unitshaving a tree structure within the maximum coding unit 1900 may bedefined as the order of from the coding units having a depth of 2(1910→1912→1914→1916), to the coding units having a depth of 3(1920→1922→1924→1926), to the coding units having a depth of 3(1930→1932→1934→1936), to the coding units having a depth of 3(1940→1942→1944→1946), to the coding units having a depth of 3(1950→1953→1954→1956), to the coding units having a depth of 2(1960→1962→1964→1966), and to the coding unit 1970 having a depth of 1.

FIG. 20 illustrates scan indices of partitions of a prediction unitaccording to partition types, according to an exemplary embodiment.Referring to FIG. 20, the partitions of the prediction unit may bedefined as symmetrical partition types 2050, 2052, 2054, and 2056 andasymmetrical partition types 2060, 2062, 2064, and 2066 according toratios at which at least one of a height and a width of the predictionunit is split.

A location of the prediction unit may be expressed as an index of aprediction unit which is defined according to a size of a minimum unit.Numerals 0, 1, 2, and 3 marked within the symmetrical partition types2050, 2052, 2054, and 2056 and the asymmetrical partition types 2060,2062, 2064, and 2066 are scan indices of partitions of the predictionunit.

An image data decoder 230 according to an exemplary embodiment maysearch for a location of a prediction unit based on a scan index of theprediction unit. In detail, the image data decoder 230 may search for arelative location of a pixel on the left upper end of the predictionunit compared to a sample on the left upper end of a maximum codingunit, by using the scan index of the prediction unit, the height andwidth of a minimum unit, and the size of the maximum coding unit.

The image data decoder 230 may search for a location of a PU partitionbased on a scan index of the PU partition. In detail, the image datadecoder 230 may search for a relative location of a pixel on the leftupper end of the PU partition compared to the sample on the left upperend of the prediction unit, by using the scan index of the PU partition,the height and width of a minimum unit, and the size of the predictionunit.

Similarly, the image data decoder 230 may search for a location of atransformation unit based on a scan index of the transformation unit. Indetail, the image data decoder 230 may search for a relative location ofa pixel on the left upper end of the transformation unit compared to thesample on the left upper end of the prediction unit, by using the scanindex of the transformation unit, the height and width of a minimumunit, and the size of the prediction unit.

FIG. 21 illustrates data units that may be used as neighborhoodinformation of a current data unit 2170 according to an exemplaryembodiment. Referring to FIG. 21, a video encoding apparatus 100 and avideo decoding apparatus 200 according to exemplary embodiments mayrefer to data units adjacent to the current data unit 2170 when encodingand decoding the current data unit 2170. A data unit is a maximum codingunit, a coding unit, a prediction unit, or a partition.

The data units adjacent to the current data unit X(2170) may be a leftdata unit A(2180), an upper data unit B(2182), a right upper data unitC(2184), a left upper data unit D(2186), and a left lower data unitE(2188).

FIG. 22 illustrates maximum coding units adjacent to a current maximumcoding unit 2270 according to an exemplary embodiment. Referring to FIG.22, a video encoding apparatus 100 according to an exemplary embodimentmay refer to maximum coding units adjacent to the current maximum codingunit 2270 when encoding the current maximum coding unit 2270. A videodecoding apparatus 200 according to an exemplary embodiment may refer tothe maximum coding units adjacent to the current maximum coding unit2270 when decoding the current maximum coding unit 2270.

The maximum coding units adjacent to the current maximum coding unit2270 may be a left maximum coding unit 2280, an upper maximum codingunit 2282, a right upper maximum coding unit 2284, a left upper maximumcoding unit 2286, and a left lower maximum coding unit 2288. The imagedata decoder 230 of the video decoding apparatus 200 may search foraddresses and usabilities lcuAddrA, lcuAddrB, lcuAddrC, lcuAddrD,lcuAddrE of the adjacent maximum coding units 2280, 2282, 2284, 2286,and 2288. The adjacent maximum coding units 2280, 2282, 2284, 2286, and2288 may be expressed as locations relative to an address CurrLcuAddr ofthe current maximum coding unit 2270.

An image data decoder 230 of the video decoding apparatus may checkusability of each maximum coding unit. In a case other than case (i)where a maximum coding unit is not included in a current picture, case(ii) where a maximum coding unit is not included in a current slice, andcase (iii) where an address of a maximum coding unit is later than thatof a current maximum coding unit in terms of a scanning order, the dataof the maximum coding unit may be found useable.

FIG. 23 illustrates macroblocks complying with a raster scanning method.A related art codec such as H.264 uses macroblocks that each have amaximum size of 16×16 to serve as a unit in which data is encoded.Referring to FIG. 23, although a current macroblock 2010 existing in apicture 2000 may be decoded by referring to neighboring macroblocksexisting in the same picture 2000, since macroblocks are decoded in araster scanning order, a macroblock 2020 located on a left lower side ofthe current macroblock 2010 has not yet been decoded and thus cannot bereferred to by the current macroblock 2010. Hereinafter, when anadjacent data unit cannot be referred to by a current coding unitbecause it has not yet been decoded, the adjacent data unit is definedto be not useable.

FIG. 24 illustrates a current prediction unit 2156 complying with azigzag scanning order, according to an exemplary embodiment. In anencoding method, since macroblocks are scanned according to a rasterscanning method, a second macroblock may not refer to information abouta first macroblock scanned later than the second macroblock. However, avideo encoding apparatus 100 according to an exemplary embodiment mayrefer to the first macroblock as neighboring information of the secondmacroblock in order to encode the second macroblock.

Referring to FIG. 24, taking a picture 2100 as an example, a maximumcoding unit having a size of 64×64 is decoded in a zigzag scanning orderof coding units 2110, 2120, 2130, and 2140 corresponding to a depthof 1. Furthermore, coding units 2142, 2144, 2146, and 2148 correspondingto a depth of 2 in the coding unit 2140 corresponding to a depth of 1are also scanned in a zigzag order.

In the zigzag scanning order, after the coding unit 2140 of a depth of 1is decoded, a coding unit 2150 of a depth of 1 is decoded. Decoding ofthe coding unit 2150 of a depth of 1 is performed in the order of codingunits 2152, 2154, and 2156 corresponding to a depth of 2. Since thecoding unit 2144 of a depth of 2 exists on the left lower side of thecoding unit 2156 having a depth of 2 and has already been decodedaccording to the zigzag scanning order, the coding unit 2144 of a depthof 2 may be referred to, as neighborhood information of the coding unit2156 of a depth of 2. If the coding unit 2156 of a depth of 2 is nolonger split to a lower depth, the coding unit 2156 becomes a predictionunit, and the prediction unit 2156 may be prediction-decoded byreferring to the coding unit 2144 of a depth of 2.

According to a raster scanning method, the coding unit 2144 is decodedlater than the coding unit 2156, and thus information about the codingunit 2144 may not be referred to when decoding the coding unit 2156.

FIG. 25 illustrates minimum units adjacent to a current partition,according to an exemplary embodiment. Referring to FIG. 25, maximumcoding units 2210, 2220, and 2230 corresponding to a depth of 0 exist,and a minimum coding unit 2240 is set to have a depth of 3. Neighborhoodinformation of a current partition 2250 of a current maximum coding unit2210 indicates an external minimum unit adjacent to a minimum unit inthe current partition 2250.

For example, left neighborhood information, upper neighborhoodinformation, and left upper neighborhood information of the currentpartition 2250 indicate minimum units 2262, 2260, and 2266 located on aleft side, an upper side, and a left upper side of a minimum unit 2256located on a left upper side of the current partition 2250.

Right upper neighborhood information of the current partition 2250indicates a minimum unit 2264 located on a right upper side of a minimumunit 2254 located on a right upper side of the current partition 2250.Left lower neighborhood information of the current partition 2250indicates a minimum unit 2268 located on a left lower side of a minimumunit 2256 located on a left lower side of the current partition 2250.

The image data decoder 230 of a video decoding apparatus 200 accordingto an exemplary embodiment may check a location and usability of aminimum unit or a maximum coding unit that is adjacent to a currentpartition. The address of the adjacent minimum unit or the location ofthe maximum coding unit may be expressed as an index of the minimum unitadjacent to the current partition or an address of a maximum coding unitincluding the adjacent minimum unit.

In a case other than case (i) where a maximum coding unit is notincluded in a current picture, case (ii) where a maximum coding unit isnot included in a current slice, case (iii) where an address of amaximum coding unit is later than that of a current maximum coding unitin terms of a scanning order, or case (iv) where an index of a minimumunit on a left upper side of a deeper coding unit according to a zigzagscanning order is later than that of a current minimum unit according toa zigzag scanning order in terms of a scanning order, the data of thedeeper coding unit may be found usable.

To search for neighborhood information of a current partition, an indexof a minimum unit located on a left upper side, a right upper side, or aleft lower side within the current partition may be considered, andsplitting type information and information about a current depth areused. If all partitions are not the same in size, indices of partitionsfor a current prediction unit are used.

FIG. 26 is a diagram for explaining a motion vector predicting methodusing neighborhood information, according to an exemplary embodiment. Avideo encoding apparatus 100 and a video decoding apparatus 200according to exemplary embodiments may refer to a motion vector of aprediction unit adjacent to a current prediction unit when performingmotion prediction based on an inter mode.

That is, referring to FIG. 26, to predict motion information of acurrent prediction unit 2300, pieces of motion information MV_A(2310),MV_B(2320), MV_C(2330), MV_D(2340), and MV_E(2350) of prediction unitsadjacent to the current prediction unit 2300 may be referred to. Themotion information pieces MV_A(2310), MV_B(2320), MV_C(2330),MV_D(2340), and MV_E(2350) are neighborhood information of the currentprediction unit 2300, i.e., information about prediction units locatedon a left side, an upper side, a right upper side, a left upper side,and a left lower side of the current prediction unit 2300. The motioninformation pieces MV_A(2310), MV_B(2320), MV_C(2330), MV_D(2340), andMV_E(2350) may be searched for by using respective encoding informationof minimum units of corresponding prediction units.

FIG. 27 illustrates an interpolating method using neighborhoodinformation, according to an exemplary embodiment. A video encodingapparatus 100 and a video decoding apparatus 200 according to exemplaryembodiments may refer to a pixel value of a pixel on a boundary of aprediction unit adjacent to a current prediction unit when performingprediction encoding based on an intra mode.

That is, referring to FIG. 27, a pixel value of a current predictionunit 2400 may be predicted by referring to pixel values of pixels on aboundary of data units adjacent to the current prediction unit 2400,i.e., context pixels 2410 and 2420. The context pixel 2430 isneighborhood information of the current prediction unit 2400, i.e.,information of pixels located on a left lower side of the currentprediction unit 2400.

In a related art codec based on macroblocks complying with a rasterscanning order, information about a neighborhood located on a left lowerside of a current macroblock, that is, the motion information MV_E(2350)or the context pixel 2430, cannot be used as the neighborhoodinformation.

However, a video encoding apparatus 100 and a video decoding apparatus200 according to exemplary embodiments may refer to information about aneighborhood located on a left lower side of a current data unit sincecoding units according to hierarchical depths are encoded and decodedaccording to a zigzag scanning order. Thus, if the video encodingapparatus 100 and the video decoding apparatus 200 find the informationabout neighborhood located on the left lower side of the current dataunit useable, the video encoding apparatus 100 and the video decodingapparatus 200 may refer to the neighborhood information when encoding ordecoding the current data unit.

FIG. 28 is a flowchart illustrating a method of encoding a video byreferring to neighborhood information, according to an exemplaryembodiment. Referring to FIG. 28, in operation 2510, a current pictureis split into at least one maximum coding unit.

In operation 2520, at least one coded depth is determined by encodingimage data corresponding to each maximum coding unit based on codingunits hierarchically split as a depth increases, and a coding unitaccording to a tree structure is determined. The maximum coding unit isspatially split whenever the depth deepens, and thus is split intocoding units of a lower depth. Each coding unit may be split into codingunits of another lower depth by being spatially split independently fromadjacent coding units. Encoding is repeatedly performed on each codingunit according to depths. Also, partition types and transformation unitshaving a minimum encoding error are determined for each deeper codingunit. In order to determine a coded depth having a minimum encodingerror in each maximum coding unit, encoding errors may be measured andcompared in all deeper coding units according to depths.

The image data is encoded in consideration of a raster scanning orderamong maximum coding units and a zigzag scanning order between deepercoding units included in each of the maximum coding units. The imagedata may also be encoded by referring to useable neighborhoodinformation in consideration of a scanning order among data units.

In operation 2530, encoded image data of the final encoding resultaccording to the coded depth is output for each maximum coding unit,with encoded information about the coded depth and an encoding mode. Theencoded information about the encoding mode may include informationabout a coded depth or split information, information about a partitiontype of a prediction unit, a prediction mode, and a size of atransformation unit. The encoded information about the encoding mode maybe transmitted to a decoder with the encoded image data.

FIG. 29 is a flowchart illustrating a method of decoding a video byreferring to neighborhood information, according to an exemplaryembodiment. Referring to FIG. 29, in operation 2610, a bitstream of anencoded video is received and parsed.

In operation 2620, encoded image data of a current picture assigned to amaximum coding unit is acquired from the parsed bitstream, andinformation about a coded depth and an encoding mode according tomaximum coding units are extracted from the parsed bitstream.

The coded depth of each maximum coding unit is a depth having a minimumencoding error in each maximum coding unit. In encoding each maximumcoding unit, the image data is encoded based on at least one data unitobtained by hierarchically splitting each maximum coding unit accordingto depths.

According to the information about the coded depth and the encodingmode, the maximum coding unit may be split into coding units having atree structure. Each of the coding units having the tree structure isdetermined as a coding unit corresponding to a coded depth, and isoptimally encoded as to output the minimum encoding error. Accordingly,encoding and decoding efficiency of an image may be improved by decodingeach piece of encoded image data in the coding units having a treestructure after determining at least one coded depth according to codingunits.

In operation 2530, the encoded image data of each maximum coding unit isdecoded in consideration of a raster scanning order among maximum codingunits and a zigzag scanning order between deeper coding units includedin each of the maximum coding units. Locations of maximum coding unitsaccording to a raster scanning order and locations of deeper codingunits according to a zigzag scanning order may be searched for, andindices of minimum units according to a zigzag scanning order andindices of minimum units according to a raster scanning order may bemutually transformed to each other.

Usability of neighborhood information may be checked and theneighborhood information may be referred to in order to decode apredetermined coding unit, in consideration of a scanning order ofvarious hierarchical data units, such as a raster scanning order formaximum coding units or prediction units or a zigzag scanning order or araster scanning order for minimum units. The neighboring informationaccording to an exemplary embodiment may include information about adata unit located on a left lower side of a current data unit.

The decoded image data may be reproduced by a reproducing apparatus,stored in a storage medium, or transmitted through a network accordingto one or more exemplary embodiments.

Furthermore, one or more exemplary embodiments can be written ascomputer programs and can be implemented in general-use digitalcomputers that execute the programs using a computer readable recordingmedium. Examples of the computer readable recording medium includemagnetic storage media (e.g., ROM, floppy disks, hard disks, etc.) andoptical recording media (e.g., CD-ROMs, or DVDs).

While exemplary embodiments have been particularly shown and described,it will be understood by those of ordinary skill in the art that variouschanges in form and details may be made therein without departing fromthe spirit and scope of the present inventive concept as defined by theappended claims. The exemplary embodiments should be considered indescriptive sense only and not for purposes of limitation. Therefore,the scope of the present inventive concept is defined not by thedetailed description of exemplary embodiments, but by the appendedclaims, and all differences within the scope will be construed as beingincluded in the present inventive concept.

What is claimed is:
 1. A method of decoding a video, the methodcomprising: receiving and parsing a bitstream of an encoded video;extracting, from the bitstream, encoded image data of a current pictureof the encoded video assigned to a maximum coding unit of the currentpicture, and information about a coded depth and an encoding modeaccording to the maximum coding unit, wherein the maximum coding unit isa coding unit of the current picture having a maximum size; and decodingthe encoded image data for the maximum coding unit based on theinformation about the coded depth and the encoding mode for the maximumcoding unit, in consideration of a raster scanning order for the maximumcoding unit and a zigzag scanning order for coding units of the maximumcoding unit according to depths, wherein the maximum coding unit isspatially split into at least one coding unit according to at least onedepth, and as a depth deepens from an uppermost depth, the maximumcoding unit is hierarchically split from the maximum coding unitcorresponding to the uppermost depth to at least one minimum coding unitcorresponding to a lowermost depth of the at least one depth, whereinthe at least one coding unit is a deeper coding unit.
 2. The method ofclaim 1, wherein the decoding the encoded image data comprises analyzinga hierarchical structure of at least one deeper coding unit for themaximum coding unit by using the information about the coded depth andthe encoding mode for the maximum coding unit.
 3. The method of claim 1,wherein the decoding the encoded image data comprises searching for alocation of the maximum coding unit, based on an address of the maximumcoding unit according to the raster scanning order.
 4. The method ofclaim 1, wherein the decoding the encoded image data comprises searchingfor a location of a minimum unit, of the at least one minimum unit,based on an index of the minimum unit according to a zigzag scanningorder for the maximum coding unit.
 5. The method of claim 1, wherein thedecoding the encoded image data comprises searching for a location of aminimum unit, of the at least one minimum unit, based on an index of theminimum unit according to a raster scanning order for the maximum codingunit.
 6. The method of claim 1, wherein the decoding the encoded imagedata comprises mutually transforming an index of the at least oneminimum unit according to a zigzag scanning order and an index of the atleast one minimum unit according to a raster scanning order to eachother, for the maximum coding unit.
 7. The method of claim 1, wherein alocation of the maximum coding unit is expressed as a location of apixel located on a left upper end of the maximum coding unit that isrelative to a location of a sample located on a left upper end of thecurrent picture.
 8. The method of claim 1, wherein a location of aminimum unit, of the at least one minimum unit, is expressed as alocation of a pixel located on a left upper end of the minimum unit thatis relative to a location of a sample located on a left upper end of themaximum coding unit.
 9. The method of claim 1, wherein the decoding theencoded image data comprises referring to neighborhood information bychecking usability of the neighborhood information, in consideration ofa scanning order of the maximum coding unit, a prediction unit, apartition, and a minimum unit of the at least one minimum unit.
 10. Themethod of claim 1, wherein the decoding the encoded image data compriseschecking usability of the maximum coding unit.
 11. The method of claim10, wherein in a case other than a case where the maximum coding unit isnot included in the current picture, a case where the maximum codingunit is not included in a current slice, and a case where an address ofthe maximum coding unit is later than an address of a current maximumcoding unit in terms of a scanning order, data corresponding to themaximum coding unit is useable.
 12. The method of claim 1, wherein thedecoding the encoded image data further comprises checking usability ofa deeper coding unit of the maximum coding unit.
 13. The method of claim12, wherein in a case other than a case where the maximum coding unit isnot included in the current picture, a case where the maximum codingunit is not included in a current slice, a case where an address of themaximum coding unit is later than an address of a current maximum codingunit in terms of a scanning order, and a case where an index of aminimum unit on a left upper side of a deeper coding unit according to azigzag scanning order is later in terms of a scanning order than anindex of a current minimum unit according to a zigzag scanning order,data corresponding to the deeper coding unit is useable.
 14. The methodof claim 1, wherein the decoding the encoded image data compriseschecking at least one maximum coding unit adjacent to the maximum codingunit and usability of the at least one adjacent maximum coding unit. 15.The method of claim 14, wherein the at least one maximum coding unitadjacent to the maximum coding unit comprises at least one of a maximumcoding unit on a left side of the maximum coding unit, a maximum codingunit on an upper side of the maximum coding unit, a maximum coding uniton a right upper side of the maximum coding unit, and a maximum codingunit on a left upper side of the maximum coding unit.
 16. The method ofclaim 1, wherein the decoding the encoded image data further compriseschecking at least one minimum unit adjacent to a current prediction unitincluded in the maximum coding unit and usability of the at least oneadjacent minimum unit.
 17. The method of claim 16, wherein the at leastone minimum unit adjacent to the current prediction unit comprises atleast one of a minimum unit on a left side of the current predictionunit, a minimum unit on an upper side of the current prediction unit, aminimum unit on a right upper side of the current prediction unit, aminimum unit on a left upper side of the current prediction unit, and aminimum unit on a left lower side of the current prediction unit. 18.The method of claim 1, wherein the decoding the encoded image datafurther comprises checking a location and usability of at least oneboundary adjacent to the maximum coding unit.
 19. The method of claim18, wherein the at least one boundary adjacent to the maximum codingunit comprises at least one of a maximum coding unit on a left side ofthe maximum coding unit, a maximum coding unit on an upper side of themaximum coding unit, a maximum coding unit on a right upper side of themaximum coding unit, and a maximum coding unit on a left upper side ofthe maximum coding unit.
 20. The method of claim 1, wherein a minimumunit, of the at least one minimum unit, is assigned with encodinginformation comprising at least one of information about a correspondingdeeper coding unit, information about splitting of the correspondingdeeper coding unit into a prediction unit or a partition, andinformation about a prediction mode of the prediction unit or thepartition.
 21. The method of claim 20, wherein the decoding the encodedimage data comprises checking usability of a deeper coding unit or aprediction unit that includes the minimum unit, based on the encodinginformation assigned to the minimum unit.
 22. The method of claim 1,wherein: the maximum coding unit comprises a plurality of coding units;and when a first coding unit, of the plurality of coding units, which isadjacent to a second coding unit, of the plurality of coding units, isscanned later than the second coding unit according to a raster scanningorder and the first coding unit is scanned earlier than the secondcoding unit according to a zigzag scanning order, the first coding unitis referenced to decode the second coding unit.
 23. The method of claim22, wherein when the first coding unit is on a left lower side of thesecond coding unit, the first coding unit is referenced to decode thesecond coding unit.
 24. The method of claim 23, wherein when the firstcoding unit is on a left lower side of the second coding unit, a rightboundary of the first coding unit is referenced to decode the secondcoding unit.
 25. An apparatus for decoding a video, the apparatuscomprising: a receiver which receives and parses a bitstream of anencoded video; an image data and encoding information extractor whichextracts, from the bitstream, encoded image data of a current picture ofthe encoded video assigned to a maximum coding unit of the currentpicture, and information about a coded depth and an encoding modeaccording to the maximum coding unit, wherein the maximum coding unit isa coding unit of the current picture having a maximum size; and an imagedata decoder which decodes the encoded image data for the maximum codingunit based on the information about the coded depth and the encodingmode for the maximum coding unit, in consideration of a raster scanningorder for the maximum coding unit and a zigzag scanning order for codingunits of the maximum coding unit according to depths, wherein themaximum coding unit is spatially split into at least one coding unitaccording to at least one depth, and as a depth deepens from anuppermost depth, the maximum coding unit is hierarchically split fromthe maximum coding unit corresponding to the uppermost depth to at leastone minimum coding unit corresponding to a lowermost depth of the atleast one depth.
 26. A non-transitory computer readable recording mediumhaving recorded thereon a program for executing the method of claim 1.27. A method of decoding a video, the method comprising: extracting,from a bitstream, encoded image data of a current picture of the videoassigned to a maximum coding unit of the current picture, andinformation about a coded depth according to the maximum coding unit,wherein the maximum coding unit is a coding unit of the current picturehaving a maximum size; and decoding the encoded image data for themaximum coding unit based on the information about the coded depth, inconsideration of a raster scanning order for the maximum coding unit anda zigzag scanning order for coding units of the maximum coding unitaccording to depths, wherein the maximum coding unit is spatially splitinto at least one coding unit according to at least one depth, and as adepth deepens from an uppermost depth, the maximum coding unit ishierarchically split from the maximum coding unit corresponding to theuppermost depth to at least one minimum coding unit corresponding to alowermost depth of the at least one depth, wherein the at least onecoding unit is a deeper coding unit.
 28. A non-transitory computerreadable recording medium having recorded thereon a program forexecuting the method of claim 27.